[Zope3-checkins] SVN: Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c Code cleanup

Ruslan Spivak rspivak at nuxeo.com
Thu Aug 11 16:28:21 EDT 2005


Log message for revision 37879:
  Code cleanup

Changed:
  U   Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c

-=-
Modified: Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c
===================================================================
--- Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c	2005-08-11 20:28:03 UTC (rev 37878)
+++ Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c	2005-08-11 20:28:19 UTC (rev 37879)
@@ -252,18 +252,18 @@
                 /* Simple adapter */
                 PyObject *req = PySequence_GetItem(required, 0);
                 if (req == NULL)
-                        goto on_error;
+                        return NULL;
                 surrogate = PyObject_CallMethodObjArgs((PyObject *)self,
                                                        strget, req, NULL);
                 Py_DECREF(req);
                 if (surrogate == NULL)
-                        goto on_error;
+                        return NULL;
 
                 byname = PyObject_CallMethodObjArgs(surrogate, strget,
                                                     provided, NULL);
                 Py_XDECREF(surrogate);
                 if (byname == NULL)
-                        goto on_error;
+                        return NULL;
 
                 if (byname != Py_None) {
                         value = PyDict_GetItem(byname, name);
@@ -279,7 +279,7 @@
                                                             strget,
                                                             provided, NULL);
                         if (byname == NULL)
-                                goto on_error;
+                                return NULL;
 
                         if (byname != Py_None) {
                                 value = PyDict_GetItem(byname, name);
@@ -296,9 +296,6 @@
                 Py_INCREF(value);
                 return value;
 
-        on_error:
-                return NULL;
-
         } else if (!order) {
                 /* null adapter */
                 byname = PyObject_CallMethodObjArgs(self->_null,
@@ -326,7 +323,7 @@
 
         with = PySequence_GetSlice(required, 1, order); /* new reference */
         if (with == NULL)
-                goto fail_with;
+                return NULL;
         PyObject *key = Py_BuildValue("Oi", provided, order);
 
         PyObject *req = PySequence_GetItem(required, 0);
@@ -481,7 +478,6 @@
 
 fail_req:
         Py_DECREF(with);
-fail_with:
         return NULL;
 }
 
@@ -491,9 +487,8 @@
         PyObject *required, *provided;
         PyObject *name = emptystr;
         PyObject *_default = Py_None;
-        PyObject *required_list;
         PyObject *res;
-        PyObject *param_args, *kw;
+        PyObject *param_args;
 
         static char *kwlist[] = {"required", "provided", "name", "default",
                                  NULL};



More information about the Zope3-Checkins mailing list