refactor: Satisfy Semgrep

This commit is contained in:
NotMyFault
2021-12-22 02:06:07 +01:00
parent 3da1e9255a
commit af2613202d
2 changed files with 3 additions and 5 deletions

View File

@ -286,15 +286,13 @@ public class StringMan {
}
public static boolean isEqualIgnoreCase(String a, String b) {
return (a == b) || ((a != null) && (b != null) && (a.length() == b.length()) && a
return (a.equals(b)) || ((a != null) && (b != null) && (a.length() == b.length()) && a
.equalsIgnoreCase(b));
}
public static String repeat(String s, int n) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
sb.append(s);
}
sb.append(String.valueOf(s).repeat(Math.max(0, n)));
return sb.toString();
}