Only compute if absent/present if compute is not needed (locking opts)

This commit is contained in:
cyberpwn
2021-09-13 09:31:56 -04:00
parent ca961e8498
commit eeab12ed86
18 changed files with 25 additions and 64 deletions

View File

@@ -499,11 +499,7 @@ public class VolmitSender implements CommandSender {
public void sendDecreeHelpNode(VirtualDecreeCommand i) {
if (isPlayer() || s instanceof CommandDummy) {
sendMessageRaw(helpCache.compute(i.getPath(), (k, v) -> {
if (v != null) {
return v;
}
sendMessageRaw(helpCache.computeIfAbsent(i.getPath(), (k) -> {
String newline = "<reset>\n";
/// Command