summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-05-04 00:30:17 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-05-04 00:30:17 (GMT)
commite894e93f4c5be0ab3a7c7cc59830723610599ad6 (patch)
treebb8853b7bcafa130a87ee5503d0d7ffe3de05169
parent79832844727411e374f638d6045e2d100e6c31fd (diff)
downloadcpython-e894e93f4c5be0ab3a7c7cc59830723610599ad6.zip
cpython-e894e93f4c5be0ab3a7c7cc59830723610599ad6.tar.gz
cpython-e894e93f4c5be0ab3a7c7cc59830723610599ad6.tar.bz2
Remove a redundant string length check and variable assignment.
Found with Clang's static analyzer.
-rw-r--r--Modules/cPickle.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index d89e810..79eebca 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -864,7 +864,7 @@ whichmodule(PyObject *global, PyObject *global_name)
*global_name_attr = 0, *name = 0;
module = PyObject_GetAttrString(global, "__module__");
- if (module)
+ if (module)
return module;
if (PyErr_ExceptionMatches(PyExc_AttributeError))
PyErr_Clear();
@@ -903,7 +903,6 @@ whichmodule(PyObject *global, PyObject *global_name)
like this rule. jlf
*/
if (!j) {
- j=1;
name=__main___str;
}
@@ -1235,9 +1234,6 @@ save_string(Picklerobject *self, PyObject *args, int doput)
int i;
char c_str[5];
- if ((size = PyString_Size(args)) < 0)
- return -1;
-
if (size < 256) {
c_str[0] = SHORT_BINSTRING;
c_str[1] = size;