1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 23:40:08 -08:00

Prevent operation lookups, as they pollute the cache.

This commit is contained in:
Danila Fedorin 2017-07-27 14:06:15 -07:00
parent 4f9c8dee9a
commit 15e42126b5

View File

@ -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);
}
/**