Commit c44ae588 authored by tonymanou's avatar tonymanou Committed by topjohnwu

Optimize map operations

parent b9495cd1
...@@ -17,10 +17,9 @@ public class CallbackHandler { ...@@ -17,10 +17,9 @@ public class CallbackHandler {
} }
public static void unRegister(Event event) { public static void unRegister(Event event) {
HashSet<EventListener> list = listeners.get(event); HashSet<EventListener> list = listeners.remove(event);
if (list != null) { if (list != null) {
list.clear(); list.clear();
listeners.remove(event);
} }
} }
......
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