Improve various small code quality issues
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-16 03:53:51 +01:00
parent d315b3f38a
commit 546637c188
11 changed files with 46 additions and 44 deletions

View File

@@ -9,6 +9,7 @@ import wtf.beatrice.hidekobot.HidekoBot;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Map;
public class ConfigurationSource
{
@@ -94,15 +95,18 @@ public class ConfigurationSource
// create a new mixed map that will take existing values from the non-missing keys
// and fill everything else with the default values
LinkedHashMap<String, Object> filledEntries = new LinkedHashMap<>();
for(String key : internalConfigContents.keySet())
for(Map.Entry<String, Object> entry : internalConfigContents.entrySet())
{
String key = entry.getKey();
if(fsConfigContents.containsKey(key))
{
// if the key already exists, copy the original value
filledEntries.put(key, fsConfigContents.get(key));
} else {
// else, copy the value from the example config file
filledEntries.put(key, internalConfigContents.get(key));
filledEntries.put(key, entry.getValue());
}
}