From 15e42126b5c5fa23a9d5440443a6cc1534b86aaa Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 27 Jul 2017 14:06:15 -0700 Subject: [PATCH] Prevent operation lookups, as they pollute the cache. --- src/org/nwapw/abacus/plugin/Plugin.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/org/nwapw/abacus/plugin/Plugin.java b/src/org/nwapw/abacus/plugin/Plugin.java index d702950..9e87be2 100644 --- a/src/org/nwapw/abacus/plugin/Plugin.java +++ b/src/org/nwapw/abacus/plugin/Plugin.java @@ -107,14 +107,9 @@ public abstract class Plugin { * plugin internally, which makes it accessible to the plugin manager. * @param name the name to register by. * @param toRegister the function implementation. - * @return true if the function was registered successfully, false if not. */ - protected final boolean registerFunction(String name, Function toRegister) { - if(functionFor(name) == null){ - functions.put(name, toRegister); - return true; - } - return false; + protected final void registerFunction(String name, Function toRegister) { + functions.put(name, toRegister); } /** @@ -123,14 +118,9 @@ public abstract class Plugin { * the plugin manager. * @param name the name of the operator. * @param operator the operator to register. - * @return true if the operator was registered successfully, false if not. */ - protected final boolean registerOperator(String name, Operator operator) { - if(operatorFor(name) == null){ - operators.put(name, operator); - return true; - } - return false; + protected final void registerOperator(String name, Operator operator) { + operators.put(name, operator); } /**