mirror of
https://github.com/enso-org/enso.git
synced 2024-09-19 09:07:28 +03:00
Use .isEmpty()
instead of .length() == 0
(#3314)
Minor nit - since String is a CharSequence it's advisable to use the corresponding method for checking the condition rather than writing it by hand.
This commit is contained in:
parent
8bdca89917
commit
ac5c02ed8c
@ -170,8 +170,8 @@ public class Text_Utils {
|
||||
public static boolean contains(String string, String substring) {
|
||||
// {@code StringSearch} does not handle empty strings as we would want, so we need these special
|
||||
// cases.
|
||||
if (substring.length() == 0) return true;
|
||||
if (string.length() == 0) return false;
|
||||
if (substring.isEmpty()) return true;
|
||||
if (string.isEmpty()) return false;
|
||||
StringSearch searcher = new StringSearch(substring, string);
|
||||
return searcher.first() != StringSearch.DONE;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class Parser {
|
||||
}
|
||||
|
||||
private String handleNa(String raw) {
|
||||
if (raw == null || raw.length() == 0) {
|
||||
if (raw == null || raw.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return raw;
|
||||
|
Loading…
Reference in New Issue
Block a user