Skip to content

Commit 6d70c37

Browse files
author
Yasuo Ohgaki
committed
A little optimization
1 parent 302a53d commit 6d70c37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5784,10 +5784,10 @@ PHP_FUNCTION(str_byte_compare2)
57845784
long ret = b1_len - b2_len;
57855785
int mod_len = MAX(b1_len, 1);
57865786
int min_len = MIN(b1_len, b2_len);
5787-
int n, sz=sizeof(long);
5787+
int n = 0;
57885788

57895789
/* Optimize by using word size comparison */
5790-
for (n = 0; n+sz < min_len ; n += sz) {
5790+
for (; n+sizeof(long) < min_len ; n += sizeof(long)) {
57915791
ret |= (long)p1 ^ (long)p2;
57925792
}
57935793
/* Comparet the rest, byte by byte */

0 commit comments

Comments
 (0)