Skip to content

Commit

Permalink
Fix abysmal forestry localisations performance causing slowness for a…
Browse files Browse the repository at this point in the history
…nything which gets the name of forestry items/machines.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jul 11, 2013
1 parent 5a7a43d commit ebcd62d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions resources/patches-deobfuscated.xml
Expand Up @@ -1703,6 +1703,23 @@
<replaceInitializer field="modifiers" code="$_ = java.util.Collections.newSetFromMap(new java.util.concurrent.ConcurrentHashMap());"/>
<replaceInitializer field="eventHandlers" code="$_ = java.util.Collections.newSetFromMap(new java.util.concurrent.ConcurrentHashMap());"/>
</class>
<class id="forestry.core.utils.Localization">
<newField class="nallar.collections.PartiallySynchronizedMap" code="new nallar.collections.PartiallySynchronizedMap()" field="map" static=""/>
<final>mappings,defaultMappings</final>
<synchronize field="forestry.core.utils.Localization.class">load</synchronize>
<insertAfter code="{
load(getCurrentLanguage());
}"/>
<insertAfter code="{
map.clear();
map.putAll(defaultMappings);
map.putAll(mappings);
}">load(Ljava.lang.String;)V</insertAfter>
<unsynchronize>get</unsynchronize>
<replaceMethod code="{
return (String) map.get($1);
}">get</replaceMethod>
</class>
</forestry>
<railCraft>
<class id="railcraft.common.util.misc.ChunkManager">
Expand Down

0 comments on commit ebcd62d

Please sign in to comment.