Unverified Commit 669eb135 authored by Licho's avatar Licho Committed by GitHub

fix: write function wrong operation. (#1227)

parent 9aaca3ca
...@@ -51,12 +51,7 @@ public class ConsolePool extends AbstractPool<StringBuilder> { ...@@ -51,12 +51,7 @@ public class ConsolePool extends AbstractPool<StringBuilder> {
} }
public static void write(String str, Integer userId) { public static void write(String str, Integer userId) {
String user = userId.toString(); String user = String.valueOf(userId);
if (consoleEntityMap.containsKey(user)) { consoleEntityMap.computeIfAbsent(user, k -> new StringBuilder("Dinky User Console:")).append(str);
consoleEntityMap.get(user).append(str);
} else {
StringBuilder sb = new StringBuilder("Dinky User Console:");
consoleEntityMap.put(user, sb.append(str));
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment