diff options
author | Furkan Onder <furkanonder@protonmail.com> | 2023-10-23 09:54:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 09:54:46 (GMT) |
commit | 32c37fe1ba708b8290cfa971e130bcfc29f1ead3 (patch) | |
tree | cb2ea772b12098a174426a058203f6683a14d8e2 /Modules/clinic/_struct.c.h | |
parent | c84b0390c053446b746b65ec82755918955e79e0 (diff) | |
download | cpython-32c37fe1ba708b8290cfa971e130bcfc29f1ead3.zip cpython-32c37fe1ba708b8290cfa971e130bcfc29f1ead3.tar.gz cpython-32c37fe1ba708b8290cfa971e130bcfc29f1ead3.tar.bz2 |
gh-67565: Remove redundant C-contiguity checks (GH-105521)
Co-authored-by: Stefan Krah <skrah@bytereef.org>
Diffstat (limited to 'Modules/clinic/_struct.c.h')
-rw-r--r-- | Modules/clinic/_struct.c.h | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 45d9071..e5118fb 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -94,10 +94,6 @@ Struct_unpack(PyStructObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) { goto exit; } - if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", "argument", "contiguous buffer", arg); - goto exit; - } return_value = Struct_unpack_impl(self, &buffer); exit: @@ -170,10 +166,6 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs if (PyObject_GetBuffer(args[0], &buffer, PyBUF_SIMPLE) != 0) { goto exit; } - if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[0]); - goto exit; - } if (!noptargs) { goto skip_optional_pos; } @@ -300,10 +292,6 @@ unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) { goto exit; } - if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", "argument 2", "contiguous buffer", args[1]); - goto exit; - } return_value = unpack_impl(module, s_object, &buffer); exit: @@ -379,10 +367,6 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) { goto exit; } - if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[1]); - goto exit; - } if (!noptargs) { goto skip_optional_pos; } @@ -452,4 +436,4 @@ exit: return return_value; } -/*[clinic end generated code: output=1749aaf639d5c11c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6a20e87f9b298b14 input=a9049054013a1b77]*/ |