mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-67565: Remove redundant C-contiguity checks (GH-105521)
Co-authored-by: Stefan Krah <skrah@bytereef.org>
This commit is contained in:
parent
c84b0390c0
commit
32c37fe1ba
30 changed files with 36 additions and 464 deletions
6
Python/clinic/import.c.h
generated
6
Python/clinic/import.c.h
generated
|
@ -605,10 +605,6 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
if (PyObject_GetBuffer(args[1], &source, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&source, 'C')) {
|
||||
_PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]);
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_source_hash_impl(module, key, &source);
|
||||
|
||||
exit:
|
||||
|
@ -627,4 +623,4 @@ exit:
|
|||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=c37ad1bf06f9e947 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=dbd63707bd40b07c input=a9049054013a1b77]*/
|
||||
|
|
6
Python/clinic/marshal.c.h
generated
6
Python/clinic/marshal.c.h
generated
|
@ -143,10 +143,6 @@ marshal_loads(PyObject *module, PyObject *arg)
|
|||
if (PyObject_GetBuffer(arg, &bytes, PyBUF_SIMPLE) != 0) {
|
||||
goto exit;
|
||||
}
|
||||
if (!PyBuffer_IsContiguous(&bytes, 'C')) {
|
||||
_PyArg_BadArgument("loads", "argument", "contiguous buffer", arg);
|
||||
goto exit;
|
||||
}
|
||||
return_value = marshal_loads_impl(module, &bytes);
|
||||
|
||||
exit:
|
||||
|
@ -157,4 +153,4 @@ exit:
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=99ba446b1a75a269 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=92d2d47aac9128ee input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue