Commit 7a7c38a9 authored by David Speck's avatar David Speck

improved version of restrict

parent cc40e92f
......@@ -124,7 +124,7 @@ class restrictOp: public MEDDLY::unary_operation {
rp = resF->linkNode(ap);
rv = av;
MEDDLY::unpacked_node::recycle(A);
delete Key;
saveResult(Key, ap, rv, rp);
return;
}
// Is a node which we want to restrict to a value
......@@ -133,17 +133,12 @@ class restrictOp: public MEDDLY::unary_operation {
// this link is important
if (A->d(val) == -1) rp = -1;
else rp = resF->linkNode(A->d(val));
MEDDLY::unpacked_node::recycle(A);
saveResult(Key, ap, A->ei(val), rp);
rv = av + A->ei(val);
/*int tmp = av + A->ei(val);
if (av > 0 && A->ei(val) > 0 && tmp < 0) {
rv = std::numeric_limits<int>::max();
} else {
rv = tmp;
}*/
if (rv < 0)
rv = std::numeric_limits<int>::max();
MEDDLY::unpacked_node::recycle(A);
delete Key;
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment