From 967e55af1e82098ebf9b925a1fbe50af0c6e3bd2 Mon Sep 17 00:00:00 2001 From: "Alexander.Kirsanov" Date: Thu, 19 Apr 2018 01:14:17 +0300 Subject: [PATCH] Reduce unneeded Registry updates in IconLoader --- platform/util/src/com/intellij/openapi/util/IconLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/util/src/com/intellij/openapi/util/IconLoader.java b/platform/util/src/com/intellij/openapi/util/IconLoader.java index 42231d71e6f9..7badc54029da 100644 --- a/platform/util/src/com/intellij/openapi/util/IconLoader.java +++ b/platform/util/src/com/intellij/openapi/util/IconLoader.java @@ -689,7 +689,7 @@ public final class IconLoader { private static T doWithTmpRegValue(@NotNull String key, @NotNull Boolean tempValue, @NotNull Callable action) { RegistryValue regVal = Registry.get(key); boolean regValOrig = regVal.asBoolean(); - regVal.setValue(tempValue); + if (regValOrig != tempValue) regVal.setValue(tempValue); try { return action.call(); } @@ -697,7 +697,7 @@ public final class IconLoader { return null; } finally { - regVal.setValue(regValOrig); + if (regValOrig != tempValue) regVal.setValue(regValOrig); } } }