Small patches for timed-calc post-1.12-merge

This commit is contained in:
Kenzie Togami
2018-10-01 16:04:48 -07:00
parent 776eb24c0e
commit e16dacc11e
4 changed files with 30 additions and 108 deletions

View File

@ -181,20 +181,20 @@ public class Expression {
}
private void pushInstance() {
Stack<Expression> foo = instance.get();
if (foo == null) {
instance.set(foo = new Stack<>());
Stack<Expression> threadLocalExprStack = instance.get();
if (threadLocalExprStack == null) {
instance.set(threadLocalExprStack = new Stack<>());
}
foo.push(this);
threadLocalExprStack.push(this);
}
private void popInstance() {
Stack<Expression> foo = instance.get();
Stack<Expression> threadLocalExprStack = instance.get();
foo.pop();
threadLocalExprStack.pop();
if (foo.isEmpty()) {
if (threadLocalExprStack.isEmpty()) {
instance.set(null);
}
}