jamsesso / json-logic-java

A pure Java implementation of JsonLogic without using the Nashorn JS engine
MIT License
99 stars 50 forks source link

Redundant storage of operations #39

Closed melniknow closed 5 months ago

melniknow commented 8 months ago

The operations are stored in a List (expressions) and when the operation is overwritten, the old version remains in the Collection.

public final class JsonLogic {
  private final List<JsonLogicExpression> expressions;
  private final Map<String, JsonLogicNode> parseCache;
  private JsonLogicEvaluator evaluator;

  public JsonLogic() {
    this.expressions = new ArrayList<>();
melniknow commented 8 months ago

Fixed here: #40