summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-04-11 14:59:33 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-04-11 14:59:33 (GMT)
commitc8aa08b1725420c00b8960f1915d5a3a7c32b8c5 (patch)
tree73033eb819c1d769f84385c7314e508910605b54 /Python/ceval.c
parentb88820058f4aa1826b23899d4378dc1a2af16b73 (diff)
downloadcpython-c8aa08b1725420c00b8960f1915d5a3a7c32b8c5.zip
cpython-c8aa08b1725420c00b8960f1915d5a3a7c32b8c5.tar.gz
cpython-c8aa08b1725420c00b8960f1915d5a3a7c32b8c5.tar.bz2
Some (but not all) of the why code bitfield tests ran faster as
separate equality tests. Now, all are set to their best timing.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 82a95a9..c103f14 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1650,7 +1650,8 @@ eval_frame(PyFrameObject *f)
if (PyInt_Check(v)) {
why = (enum why_code) PyInt_AS_LONG(v);
assert(why != WHY_YIELD);
- if (why & (WHY_RETURN | WHY_CONTINUE))
+ if (why == WHY_RETURN ||
+ why == WHY_CONTINUE)
retval = POP();
}
else if (PyClass_Check(v) || PyString_Check(v)) {
@@ -2289,7 +2290,7 @@ eval_frame(PyFrameObject *f)
/* Double-check exception status */
- if (why & (WHY_EXCEPTION | WHY_RERAISE)) {
+ if (why == WHY_EXCEPTION || why == WHY_RERAISE) {
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_SystemError,
"error return without exception set");
@@ -2411,7 +2412,7 @@ fast_block_end:
fast_yield:
if (tstate->use_tracing) {
if (tstate->c_tracefunc
- && (why & (WHY_RETURN | WHY_YIELD))) {
+ && (why == WHY_RETURN || why == WHY_YIELD)) {
if (call_trace(tstate->c_tracefunc,
tstate->c_traceobj, f,
PyTrace_RETURN, retval)) {