Skip to content

Commit

Permalink
Check size and length with isEmpty()
Browse files Browse the repository at this point in the history
  • Loading branch information
jyhsu2000 committed Feb 13, 2024
1 parent 4b70a3e commit 71a490d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -160,7 +160,7 @@ private void checkConfig(Locale checkLocale) {

private static Locale parseLocale(String localeName) {
//自動
if (localeName == null || localeName.equalsIgnoreCase("auto") || localeName.length() == 0) {
if (localeName == null || localeName.equalsIgnoreCase("auto") || localeName.isEmpty()) {
return Locale.getDefault();
}
//嘗試直接搜尋
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/club/kid7/bannermaker/util/IOUtil.java
Expand Up @@ -39,7 +39,7 @@ static public void saveBanner(Player player, ItemStack banner) {
for (Pattern pattern : bm.getPatterns()) {
patternList.add(pattern.getPattern().getIdentifier() + ":" + pattern.getColor());
}
if (patternList.size() > 0) {
if (!patternList.isEmpty()) {
config.set(key + ".patterns", patternList);
}
KConfigManager.save(fileName);
Expand Down

0 comments on commit 71a490d

Please sign in to comment.