Equations (EKey key, Equations eqs, PuritySolver solver) { for (int i = 0; i < eqs.results.size(); i++) { DirectionResultPair drp = eqs.results.get(i); if (drp.directionKey == Pure.asInt() || drp.directionKey == Volatile.asInt()) { EKey newKey = new EKey(key.member, fromInt(drp.directionKey), eqs.stable, false); Effects effects = solver.pending.get(newKey); if (effects == null || effects.isTop()) { effects = solver.solved.get(newKey); } if (effects == drp.result) { return eqs; } List<DirectionResultPair> newPairs; if (effects == null || effects.isTop()) { newPairs = new ArrayList<>(eqs.results.size() - 1); newPairs.addAll(eqs.results.subList(0, i)); newPairs.addAll(eqs.results.subList(i + 1, eqs.results.size())); } else { newPairs = new ArrayList<>(eqs.results); newPairs.set(i, new DirectionResultPair(Pure.asInt(), effects)); } return new Equations(newPairs, eqs.stable); } } return eqs; }