mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Optimized TikTokLiveEventHandler
This commit is contained in:
@@ -53,7 +53,6 @@ public class TikTokLiveEventHandler {
|
||||
}
|
||||
|
||||
public <T extends TikTokEvent> void unsubscribe(Class<?> clazz, EventConsumer<T> consumer) {
|
||||
if (clazz != null)
|
||||
Optional.ofNullable(events.get(clazz)).ifPresent(eventConsumers -> eventConsumers.remove(consumer));
|
||||
Optional.ofNullable(clazz).map(events::get).ifPresent(consumers -> consumers.remove(consumer));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user