We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
iequals
1 parent cc58816 commit 8b379d4Copy full SHA for 8b379d4
include/boost/beast/core/impl/string.ipp
@@ -23,29 +23,26 @@ iequals(
23
beast::string_view lhs,
24
beast::string_view rhs)
25
{
26
- auto n = lhs.size();
27
- if(rhs.size() != n)
+ if(lhs.size() != rhs.size())
28
return false;
+ auto n = lhs.size();
29
auto p1 = lhs.data();
30
auto p2 = rhs.data();
31
- char a, b;
32
// fast loop
33
while(n--)
34
35
- a = *p1++;
36
- b = *p2++;
37
- if(a != b)
+ if(*p1++ != *p2++)
38
goto slow;
39
}
40
return true;
41
slow:
+ --p1;
+ --p2;
42
do
43
44
- if( detail::ascii_tolower(a) !=
45
- detail::ascii_tolower(b))
+ if( detail::ascii_tolower(*p1++) !=
+ detail::ascii_tolower(*p2++))
46
47
48
49
50
while(n--);
51
0 commit comments