Skip to content

Commit 2fab99b

Browse files
committed
Update comment
1 parent 05a1fc2 commit 2fab99b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Objects/stringlib/fastsearch.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,10 @@ STRINGLIB(count_char)(const STRINGLIB_CHAR *s, Py_ssize_t n,
756756
static inline Py_ssize_t
757757
STRINGLIB(count_char_no_maximum)(const STRINGLIB_CHAR *s, Py_ssize_t n,
758758
const STRINGLIB_CHAR p0)
759-
/* By removing the maximum out of the loop, the compiler can optimize using
760-
vectors */
759+
/* A specialized function of count_char that does not cut off at a maximum.
760+
As a result, the compiler is able to vectorize the loop. */
761761
{
762-
Py_ssize_t i, count = 0;
763-
for (i = 0; i < n; i++) {
762+
for (Py_ssize_t i = 0; i < n; i++) {
764763
if (s[i] == p0) {
765764
count++;
766765
}

0 commit comments

Comments
 (0)