Coverage Report

Created: 2026-02-26 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/cpython/Python/pystrcmp.c
Line
Count
Source
1
/* Cross platform case insensitive string compare functions
2
 */
3
4
#include "Python.h"
5
6
int
7
PyOS_mystrnicmp(const char *s1, const char *s2, Py_ssize_t size)
8
21.3k
{
9
21.3k
    const unsigned char *p1, *p2;
10
21.3k
    if (size == 0)
11
627
        return 0;
12
20.6k
    p1 = (const unsigned char *)s1;
13
20.6k
    p2 = (const unsigned char *)s2;
14
29.4k
    for (; (--size > 0) && *p1 && *p2 && (Py_TOLOWER(*p1) == Py_TOLOWER(*p2));
15
20.6k
         p1++, p2++) {
16
8.74k
        ;
17
8.74k
    }
18
20.6k
    return Py_TOLOWER(*p1) - Py_TOLOWER(*p2);
19
21.3k
}
20
21
int
22
PyOS_mystricmp(const char *s1, const char *s2)
23
0
{
24
0
    const unsigned char *p1 = (const unsigned char *)s1;
25
0
    const unsigned char *p2 = (const unsigned char *)s2;
26
0
    for (; *p1 && *p2 && (Py_TOLOWER(*p1) == Py_TOLOWER(*p2)); p1++, p2++) {
27
0
        ;
28
0
    }
29
0
    return (Py_TOLOWER(*p1) - Py_TOLOWER(*p2));
30
0
}