Commit f8ef06ac authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

acc: fix operator| and operator&

Bug introduced in abe2c08b, visible in tests/python/product.ipynb,
and tests/python/acc_cond.ipynb.

* spot/twa/acc.hh: fix operator| and operator&.
* tests/python/acc_cond.ipynb: Adjust test case.
parent 2e8a6702
...@@ -686,7 +686,9 @@ namespace spot ...@@ -686,7 +686,9 @@ namespace spot
acc_code operator&(const acc_code& r) acc_code operator&(const acc_code& r)
{ {
return *this &= r; acc_code res = *this;
res &= r;
return res;
} }
acc_code operator&(acc_code&& r) acc_code operator&(acc_code&& r)
...@@ -789,9 +791,11 @@ namespace spot ...@@ -789,9 +791,11 @@ namespace spot
return res; return res;
} }
acc_code& operator|(const acc_code& r) acc_code operator|(const acc_code& r)
{ {
return *this |= r; acc_code res = *this;
res |= r;
return res;
} }
acc_code& operator<<=(unsigned sets) acc_code& operator<<=(unsigned sets)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.5.3+" "version": "3.5.4"
}, },
"name": "" "name": ""
}, },
...@@ -720,8 +720,8 @@ ...@@ -720,8 +720,8 @@
"output_type": "stream", "output_type": "stream",
"stream": "stdout", "stream": "stdout",
"text": [ "text": [
"((Fin(4) & Inf(5)) | (Fin(6) & Inf(7))) & ((Fin(0) & Inf(1)) | (Fin(2) & Inf(3)))\n", "(Fin(0) & Inf(1)) | (Fin(2) & Inf(3))\n",
"((Inf(4) | Fin(5)) & (Inf(6) | Fin(7))) | ((Inf(0) | Fin(1)) & (Inf(2) | Fin(3)))\n" "(Inf(0) | Fin(1)) & (Inf(2) | Fin(3))\n"
] ]
} }
], ],
...@@ -1426,15 +1426,6 @@ ...@@ -1426,15 +1426,6 @@
} }
], ],
"prompt_number": 52 "prompt_number": 52
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": null
} }
], ],
"metadata": {} "metadata": {}
......
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