summaryrefslogtreecommitdiffstats
path: root/Modules/datetimemodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-31 04:32:55 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-31 04:32:55 (GMT)
commit1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5 (patch)
treeb35d6a88c4ded09687f9916e4d4c0b03bafde580 /Modules/datetimemodule.c
parent538d17aa233e99a0652d0c6d482845e8e909b6e0 (diff)
downloadcpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.zip
cpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.tar.gz
cpython-1fe5f388529dcdf674d53f7d67abc16c9c6ca5e5.tar.bz2
Remove checking redundantly for checks of PyInt and PyLong.
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r--Modules/datetimemodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 046354c..14990a3 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -1758,11 +1758,11 @@ delta_multiply(PyObject *left, PyObject *right)
if (PyDelta_Check(left)) {
/* delta * ??? */
- if (PyInt_Check(right) || PyLong_Check(right))
+ if (PyLong_Check(right))
result = multiply_int_timedelta(right,
(PyDateTime_Delta *) left);
}
- else if (PyInt_Check(left) || PyLong_Check(left))
+ else if (PyLong_Check(left))
result = multiply_int_timedelta(left,
(PyDateTime_Delta *) right);
@@ -1778,7 +1778,7 @@ delta_divide(PyObject *left, PyObject *right)
if (PyDelta_Check(left)) {
/* delta * ??? */
- if (PyInt_Check(right) || PyLong_Check(right))
+ if (PyLong_Check(right))
result = divide_timedelta_int(
(PyDateTime_Delta *)left,
right);
@@ -1807,7 +1807,7 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
assert(num != NULL);
- if (PyInt_Check(num) || PyLong_Check(num)) {
+ if (PyLong_Check(num)) {
prod = PyNumber_Multiply(num, factor);
if (prod == NULL)
return NULL;
@@ -1855,7 +1855,7 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
* fractional part requires float arithmetic, and may
* lose a little info.
*/
- assert(PyInt_Check(factor) || PyLong_Check(factor));
+ assert(PyLong_Check(factor));
dnum = PyLong_AsDouble(factor);
dnum *= fracpart;