diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:54:55 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-09-17 07:54:55 (GMT) |
commit | ca56dd4767617a2f5e946130de4beb06442a5cd5 (patch) | |
tree | 8697f0e83d6b4f3758eaf4b89abc944b6e6db71f /Python/bltinmodule.c | |
parent | fd2f85d6e4e8abc9c943cf56cf45527d522c7882 (diff) | |
download | cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.zip cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.tar.gz cpython-ca56dd4767617a2f5e946130de4beb06442a5cd5.tar.bz2 |
Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 2977bcd..f03e488 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2923,20 +2923,20 @@ filterstring(PyObject *func, PyObject *strobj) if (need<2*outlen) { need = 2*outlen; - } - if (_PyString_Resize(&result, need)) { - Py_DECREF(item); - return NULL; - } - outlen = need; - } - memcpy( - PyString_AS_STRING(result) + j, - PyString_AS_STRING(item), - reslen - ); - j += reslen; } + if (_PyString_Resize(&result, need)) { + Py_DECREF(item); + return NULL; + } + outlen = need; + } + memcpy( + PyString_AS_STRING(result) + j, + PyString_AS_STRING(item), + reslen + ); + j += reslen; + } } Py_DECREF(item); if (ok < 0) @@ -3031,29 +3031,27 @@ filterunicode(PyObject *func, PyObject *strobj) assert(outlen >= 0); if (need > outlen) { - /* overallocate, - to avoid reallocations */ + /* overallocate, to avoid reallocations */ if (need < 2 * outlen) { - if (outlen > PY_SSIZE_T_MAX / 2) { - Py_DECREF(item); - return NULL; - } else { - need = 2 * outlen; - } - } - - if (PyUnicode_Resize( - &result, need) < 0) { - Py_DECREF(item); - goto Fail_1; - } - outlen = need; - } - memcpy(PyUnicode_AS_UNICODE(result) + j, - PyUnicode_AS_UNICODE(item), - reslen*sizeof(Py_UNICODE)); - j += reslen; + if (outlen > PY_SSIZE_T_MAX / 2) { + Py_DECREF(item); + return NULL; + } else { + need = 2 * outlen; + } } + + if (PyUnicode_Resize(&result, need) < 0) { + Py_DECREF(item); + goto Fail_1; + } + outlen = need; + } + memcpy(PyUnicode_AS_UNICODE(result) + j, + PyUnicode_AS_UNICODE(item), + reslen*sizeof(Py_UNICODE)); + j += reslen; + } } Py_DECREF(item); if (ok < 0) |