@@ -1147,17 +1147,13 @@ typedef enum {
11471147 NEEDLE_PACKED , /* the value was packed into the needle */
11481148} needle_result ;
11491149
1150- /* Check whether the items of view can be compared with value by their bytes.
1150+ /* Check whether the items of view can be value compared by their bytes.
11511151
11521152 They can when the items are in a native integer format and value is an
1153- exact int or a bool: two such integers are equal exactly when their bytes
1154- are equal. This is not so for floats (0.0 == -0.0) or for int subclasses,
1155- which can override __eq__(). The items must also be C-contiguous and
1156- aligned, since the stringlib search reads them as uint8_t to uint64_t.
1157-
1158- Return NEEDLE_PACKED with value packed into *needle, NEEDLE_NO_MATCH if
1159- value is out of range for the format so that no item can equal it, or
1160- NEEDLE_COMPARE_OBJECTS if the items have to be compared as objects. */
1153+ exact int or a bool. This is not so for floats (0.0 == -0.0) or for int
1154+ subclasses, which can override __eq__(). The items must also be
1155+ C-contiguous and aligned, since the stringlib search reads them as uint8_t
1156+ to uint64_t. */
11611157static needle_result
11621158pack_needle (const Py_buffer * view , PyObject * value , item_needle * needle )
11631159{
@@ -1245,11 +1241,7 @@ compare_item(const Py_buffer *view, const char *fmt, Py_ssize_t i,
12451241 return cmp ;
12461242}
12471243
1248- /* Get the buffer of obj for searching. Return -1 with an exception set on
1249- error, including when the buffer does not have exactly one dimension, with
1250- the errors memoryview.index() has always raised for that, or when its
1251- format is not supported, even if it has no items. Set *fmt to the format
1252- for compare_item().
1244+ /* Get the buffer of obj for searching. Set *fmt for compare_item().
12531245
12541246 The caller holds the buffer for the whole search, so a comparison which
12551247 tries to resize obj or release it raises BufferError instead of leaving
0 commit comments