]> granicus.if.org Git - python/commitdiff
Remove an unneeded variable and assignment.
authorBrett Cannon <bcannon@gmail.com>
Tue, 4 May 2010 01:16:51 +0000 (01:16 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 4 May 2010 01:16:51 +0000 (01:16 +0000)
Found using Clang's static analyzer.

Objects/unicodeobject.c

index aab33b50c0e0e877c467767182de1919675888c0..7c7e06269aa8799e607df198855f18e2304fc773 100644 (file)
@@ -4346,7 +4346,7 @@ PyUnicode_BuildEncodingMap(PyObject* string)
         if (!result)
             return NULL;
         for (i = 0; i < 256; i++) {
-            key = value = NULL;
+            value = NULL;
             key = PyInt_FromLong(decode[i]);
             value = PyInt_FromLong(i);
             if (!key || !value)
@@ -5846,7 +5846,7 @@ PyObject *replace(PyUnicodeObject *self,
         }
     } else {
 
-        Py_ssize_t n, i, j, e;
+        Py_ssize_t n, i, j;
         Py_ssize_t product, new_size, delta;
         Py_UNICODE *p;
 
@@ -5878,7 +5878,6 @@ PyObject *replace(PyUnicodeObject *self,
             return NULL;
         i = 0;
         p = u->str;
-        e = self->length - str1->length;
         if (str1->length > 0) {
             while (n-- > 0) {
                 /* look for next match */