Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r767:ed53c57cec4a Date: 2012-08-04 16:15 +0200 http://bitbucket.org/cffi/cffi/changeset/ed53c57cec4a/
Log: Move a repeated piece of code before. diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -3822,11 +3822,11 @@ } return NULL; } + if (length < 0 && cd->c_type->ct_flags & CT_ARRAY) { + length = get_array_length(cd); + } if (cd->c_type->ct_itemdescr->ct_size == sizeof(char)) { const char *start = cd->c_data; - if (length < 0 && cd->c_type->ct_flags & CT_ARRAY) { - length = get_array_length(cd); - } if (length < 0) length = strlen(start); else { @@ -3841,9 +3841,6 @@ else if (cd->c_type->ct_itemdescr->ct_flags & CT_PRIMITIVE_CHAR) { const wchar_t *start = (wchar_t *)cd->c_data; assert(cd->c_type->ct_itemdescr->ct_size == sizeof(wchar_t)); - if (length < 0 && cd->c_type->ct_flags & CT_ARRAY) { - length = get_array_length(cd); - } if (length < 0) { length = 0; while (start[length]) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit