[pypy-commit] cffi default: Minor simplification

arigo noreply at buildbot.pypy.org
Wed Jun 20 12:28:58 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r472:a13ba8a00ae6
Date: 2012-06-19 22:04 +0200
http://bitbucket.org/cffi/cffi/changeset/a13ba8a00ae6/

Log:	Minor simplification

diff --git a/c/_ffi_backend.c b/c/_ffi_backend.c
--- a/c/_ffi_backend.c
+++ b/c/_ffi_backend.c
@@ -3208,12 +3208,12 @@
             size = cd->c_type->ct_size;
     }
     else if (CTypeDescr_Check(arg)) {
-        if (((CTypeDescrObject *)arg)->ct_size < 0) {
+        size = ((CTypeDescrObject *)arg)->ct_size;
+        if (size < 0) {
             PyErr_Format(PyExc_ValueError, "ctype '%s' is of unknown size",
                          ((CTypeDescrObject *)arg)->ct_name);
             return NULL;
         }
-        size = ((CTypeDescrObject *)arg)->ct_size;
     }
     else {
         PyErr_SetString(PyExc_TypeError,


More information about the pypy-commit mailing list