]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
remove unused string WILFE attribute
authorBenjamin Peterson <benjamin@python.org>
Fri, 27 May 2011 12:53:28 +0000 (07:53 -0500)
committerBenjamin Peterson <benjamin@python.org>
Fri, 27 May 2011 12:53:28 +0000 (07:53 -0500)
Python/marshal.c

index 73d4f374cd0652e6a7761977c56aa03e6dc20f32..f66b765b7dc00420d6b6aa608d1e8086fe0cb867 100644 (file)
@@ -60,7 +60,6 @@ typedef struct {
     PyObject *str;
     char *ptr;
     char *end;
-    PyObject *strings; /* dict on marshal, list on unmarshal */
     int version;
 } WFILE;
 
@@ -444,7 +443,6 @@ PyMarshal_WriteLongToFile(long x, FILE *fp, int version)
     wf.fp = fp;
     wf.error = WFERR_OK;
     wf.depth = 0;
-    wf.strings = NULL;
     wf.version = version;
     w_long(x, &wf);
 }
@@ -456,10 +454,8 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version)
     wf.fp = fp;
     wf.error = WFERR_OK;
     wf.depth = 0;
-    wf.strings = (version > 0) ? PyDict_New() : NULL;
     wf.version = version;
     w_object(x, &wf);
-    Py_XDECREF(wf.strings);
 }
 
 typedef WFILE RFILE; /* Same struct with different invariants */
@@ -1041,7 +1037,6 @@ PyMarshal_ReadShortFromFile(FILE *fp)
     RFILE rf;
     assert(fp);
     rf.fp = fp;
-    rf.strings = NULL;
     rf.end = rf.ptr = NULL;
     return r_short(&rf);
 }
@@ -1051,7 +1046,6 @@ PyMarshal_ReadLongFromFile(FILE *fp)
 {
     RFILE rf;
     rf.fp = fp;
-    rf.strings = NULL;
     rf.ptr = rf.end = NULL;
     return r_long(&rf);
 }
@@ -1112,11 +1106,9 @@ PyMarshal_ReadObjectFromFile(FILE *fp)
     RFILE rf;
     PyObject *result;
     rf.fp = fp;
-    rf.strings = PyList_New(0);
     rf.depth = 0;
     rf.ptr = rf.end = NULL;
     result = r_object(&rf);
-    Py_DECREF(rf.strings);
     return result;
 }
 
@@ -1128,10 +1120,8 @@ PyMarshal_ReadObjectFromString(char *str, Py_ssize_t len)
     rf.fp = NULL;
     rf.ptr = str;
     rf.end = str + len;
-    rf.strings = PyList_New(0);
     rf.depth = 0;
     result = r_object(&rf);
-    Py_DECREF(rf.strings);
     return result;
 }
 
@@ -1150,9 +1140,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
     wf.error = WFERR_OK;
     wf.depth = 0;
     wf.version = version;
-    wf.strings = (version > 0) ? PyDict_New() : NULL;
     w_object(x, &wf);
-    Py_XDECREF(wf.strings);
     if (wf.str != NULL) {
         char *base = PyBytes_AS_STRING((PyBytesObject *)wf.str);
         if (wf.ptr - base > PY_SSIZE_T_MAX) {
@@ -1242,10 +1230,8 @@ marshal_load(PyObject *self, PyObject *f)
         Py_DECREF(data);
         return NULL;
     }
-    rf.strings = PyList_New(0);
     rf.depth = 0;
     result = read_object(&rf);
-    Py_DECREF(rf.strings);
     Py_DECREF(data);
     return result;
 }
@@ -1298,10 +1284,8 @@ marshal_loads(PyObject *self, PyObject *args)
     rf.fp = NULL;
     rf.ptr = s;
     rf.end = s + n;
-    rf.strings = PyList_New(0);
     rf.depth = 0;
     result = read_object(&rf);
-    Py_DECREF(rf.strings);
     PyBuffer_Release(&p);
     return result;
 }