Refactor Language

This commit is contained in:
Reinhard Pointner 2017-01-14 05:04:44 +08:00
parent b5a031c7c4
commit 738089a6fc
1 changed files with 1 additions and 11 deletions

View File

@ -84,17 +84,7 @@ public class Language implements Serializable {
}
public boolean matches(String code) {
if (Stream.of(iso_639_1, iso_639_2B, iso_639_3, tag).anyMatch(c -> c.equalsIgnoreCase(code))) {
return true;
}
for (String c : names) {
if (c.equalsIgnoreCase(code) || code.toLowerCase().contains(c.toLowerCase())) {
return true;
}
}
return false;
return Stream.concat(Stream.of(iso_639_1, iso_639_2B, iso_639_3, tag), Stream.of(names)).anyMatch(c -> c.equalsIgnoreCase(code));
}
@Override