diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-16 14:57:35 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-16 14:57:35 +0200 |
commit | 59b200d12f0b632eee36edec6f56dc689ab0736d (patch) | |
tree | 48552f8d519b1a1d91a6e95a75c1d7d307dcd00c | |
parent | 192925d8800421a791a783307118246b9c3d922f (diff) | |
download | cython-59b200d12f0b632eee36edec6f56dc689ab0736d.tar.gz |
Avoid an unnecessary conditional branch.
-rw-r--r-- | Cython/Utility/TypeConversion.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c index 0a95d2f3c..a3550da64 100644 --- a/Cython/Utility/TypeConversion.c +++ b/Cython/Utility/TypeConversion.c @@ -779,10 +779,10 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid } } while (unlikely(remaining != 0)); - if (last_one_off) { - assert(*dpos == '0'); - dpos++; - } + // Correct dpos by 1 if we read an excess digit. + assert(!last_one_off || *dpos == '0'); + dpos += last_one_off; + length = end - dpos; ulength = length; prepend_sign = 0; |