[Zope3-checkins] CVS: ZODB4/src/persistence - persistence.c:1.6

Jeremy Hylton jeremy@zope.com
Thu, 6 Mar 2003 14:08:18 -0500


Update of /cvs-repository/ZODB4/src/persistence
In directory cvs.zope.org:/tmp/cvs-serv26608

Modified Files:
	persistence.c 
Log Message:
light reformatting of the __reduce__ method.


=== ZODB4/src/persistence/persistence.c 1.5 => 1.6 ===
--- ZODB4/src/persistence/persistence.c:1.5	Wed Mar  5 13:55:49 2003
+++ ZODB4/src/persistence/persistence.c	Thu Mar  6 14:08:16 2003
@@ -618,47 +618,46 @@
 static PyObject *
 persist_reduce(PyPersistObject *self)
 {
-  PyObject *state, *args=NULL, *result, *__getstate__;
-  PyObject *__getstate__str = NULL;
+    PyObject *state, *args=NULL, *result, *__getstate__;
+    PyObject *__getstate__str = NULL;
   
-  if (! __getstate__str)
-    {
-      __getstate__str = PyString_FromString("__getstate__");
-      if (! __getstate__str)
-        return NULL; 
+    if (! __getstate__str) {
+	__getstate__str = PyString_InternFromString("__getstate__");
+	if (! __getstate__str)
+	    return NULL; 
     }
   
-  __getstate__ = PyObject_GetAttr((PyObject*)self, __getstate__str);
-  if (! __getstate__)
-    return NULL;
+    __getstate__ = PyObject_GetAttr((PyObject*)self, __getstate__str);
+    if (! __getstate__)
+	return NULL;
 
-  state = PyObject_CallObject(__getstate__, NULL);
-  Py_DECREF(__getstate__);
-  if (! state)
-    return NULL;
+    state = PyObject_CallObject(__getstate__, NULL);
+    Py_DECREF(__getstate__);
+    if (! state)
+	return NULL;
+  
+    args = PyTuple_New(1);
+    if (! args)
+	goto err;
+  
+    Py_INCREF(self->ob_type);
+    PyTuple_SET_ITEM(args, 0, (PyObject *)self->ob_type);
+  
+    result = PyTuple_New(3);
+    if (! result)
+	goto err;
+  
+    Py_INCREF(py_simple_new);
+    PyTuple_SET_ITEM(result, 0, py_simple_new);
+    PyTuple_SET_ITEM(result, 1, args);
+    PyTuple_SET_ITEM(result, 2, state);
   
-  args = PyTuple_New(1);
-  if (! args)
-    goto err;
-  
-  Py_INCREF(self->ob_type);
-  PyTuple_SET_ITEM(args, 0, (PyObject*)(self->ob_type));
-  
-  result = PyTuple_New(3);
-  if (! result)
-    goto err;
-  
-  Py_INCREF(py_simple_new);
-  PyTuple_SET_ITEM(result, 0, py_simple_new);
-  PyTuple_SET_ITEM(result, 1, args);
-  PyTuple_SET_ITEM(result, 2, state);
-  
-  return result;      
+    return result;      
   
  err:
-  Py_DECREF(state);
-  Py_XDECREF(args);
-  return NULL;
+    Py_DECREF(state);
+    Py_XDECREF(args);
+    return NULL;
 }
 
 static PyMethodDef persist_methods[] = {