mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
We should not create additional Strings in loop. It have perfomance impact. Using StringBuilder instead.
This commit is contained in:
parent
7f866f1b21
commit
5e410df39e
1 changed files with 3 additions and 3 deletions
|
@ -58,17 +58,17 @@ public class MagePreferences {
|
|||
}
|
||||
|
||||
public static String getUserNames() {
|
||||
String userIds = "";
|
||||
StringBuilder userIds = new StringBuilder();
|
||||
try {
|
||||
String[] keys = prefs().keys();
|
||||
for (String key : keys) {
|
||||
if (key.matches(".*userName$")) {
|
||||
userIds += "," + prefs().get(key, null);
|
||||
userIds.append(',').append(prefs().get(key, null));
|
||||
}
|
||||
}
|
||||
} catch (BackingStoreException ex) {
|
||||
}
|
||||
return userIds;
|
||||
return userIds.toString();
|
||||
}
|
||||
|
||||
public static void setUserName(String serverAddress, String userName) {
|
||||
|
|
Loading…
Reference in a new issue