Skip to content

Commit e41f764

Browse files
committed
Revert "Move declaration at top of the block"
This reverts commit b56f203. We use C99 now, this is not needed anymore.
1 parent b56f203 commit e41f764

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

Zend/zend_operators.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,32 +2624,30 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, int
26242624
if (_mm_movemask_epi8(mingle)) {
26252625
zend_string *res = zend_string_alloc(length, persistent);
26262626
memcpy(ZSTR_VAL(res), ZSTR_VAL(str), p - (unsigned char *) ZSTR_VAL(str));
2627-
do {
2628-
unsigned char *q = p + (ZSTR_VAL(res) - ZSTR_VAL(str));
2629-
2630-
/* Lowercase the chunk we already compared. */
2631-
const __m128i delta = _mm_set1_epi8('a' - 'A');
2632-
__m128i add = _mm_and_si128(mingle, delta);
2633-
__m128i lower = _mm_add_epi8(op, add);
2634-
_mm_storeu_si128((__m128i *) q, lower);
2635-
2636-
/* Lowercase the rest of the string. */
2637-
p += 16; q += 16;
2638-
zend_str_tolower_impl((char *) q, (const char *) p, end - p);
2639-
ZSTR_VAL(res)[length] = '\0';
2640-
return res;
2641-
} while (0);
2627+
unsigned char *q = p + (ZSTR_VAL(res) - ZSTR_VAL(str));
2628+
2629+
/* Lowercase the chunk we already compared. */
2630+
const __m128i delta = _mm_set1_epi8('a' - 'A');
2631+
__m128i add = _mm_and_si128(mingle, delta);
2632+
__m128i lower = _mm_add_epi8(op, add);
2633+
_mm_storeu_si128((__m128i *) q, lower);
2634+
2635+
/* Lowercase the rest of the string. */
2636+
p += 16; q += 16;
2637+
zend_str_tolower_impl((char *) q, (const char *) p, end - p);
2638+
ZSTR_VAL(res)[length] = '\0';
2639+
return res;
26422640
}
26432641
p += 16;
26442642
}
26452643
#endif
26462644

26472645
while (p < end) {
26482646
if (*p != zend_tolower_ascii(*p)) {
2649-
unsigned char *q;
26502647
zend_string *res = zend_string_alloc(length, persistent);
26512648
memcpy(ZSTR_VAL(res), ZSTR_VAL(str), p - (unsigned char*) ZSTR_VAL(str));
2652-
q = p + (ZSTR_VAL(res) - ZSTR_VAL(str));
2649+
2650+
unsigned char *q = p + (ZSTR_VAL(res) - ZSTR_VAL(str));
26532651
while (p < end) {
26542652
*q++ = zend_tolower_ascii(*p++);
26552653
}

0 commit comments

Comments
 (0)