isEmpty | “扫黄”

This commit is contained in:
林万程
2023-08-31 08:03:37 +08:00
parent 54f102fdfb
commit c37148a56a
13 changed files with 20 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ public class LineExt {
return null;
}
@Nullable Pattern pattern = ConfCache.pattern(lineInfo.project, keyMap, path);
if (pattern == null || pattern.pattern().length() == 0) {
if (pattern == null || pattern.pattern().isEmpty()) {
return null;
}
@NotNull Map<String, Map<String, List<String>>> docMap = ConfCache.docMap(path, name, ext);
@@ -100,7 +100,7 @@ public class LineExt {
@NotNull Map<String, Map<String, List<String>>> docMap,
@NotNull Map<String, Map<String, List<String>>> treeMap) {
word = word.trim();
if (word.length() == 0) {
if (word.isEmpty()) {
return false;
}
@Nullable String wordDoc = GetFromDocMap.get(docMap, word);

View File

@@ -31,7 +31,7 @@ class ConfFactory {
String key = list.get(0);
if (key.startsWith("?")) {
exclude.add(key.substring(1));
} else if (key.length() > 0 && !exclude.contains(key)) {
} else if (!key.isEmpty() && !exclude.contains(key)) {
sb.append(key).append("|");
}
}

View File

@@ -36,13 +36,13 @@ public class TsvLoader {
@NotNull List<String> words = Splitter.on('\t').splitToList(line);
if (!words.isEmpty()) {
String key = words.get(0);
if (key.length() == 0) {
if (key.isEmpty()) {
continue;
}
if (patternKey) {
key = StringEscapeUtils.unescapeJava(key);
String del = DEL_PATTERN.matcher(key).replaceAll("");
if (del.length() != 0) {
if (!del.isEmpty()) {
key = del;
}
}