Skip to content

Commit 1777fad

Browse files
committed
ext/opcache: reduce scope of variable
1 parent 80df36f commit 1777fad

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,12 @@ static zend_string* ZEND_FASTCALL accel_new_interned_string_for_php(zend_string
591591
static zend_always_inline zend_string *accel_find_interned_string_ex(zend_ulong h, const char *str, size_t size)
592592
{
593593
zend_string_table_pos_t pos;
594-
zend_string *s;
595594

596595
/* check for existing interned string */
597596
pos = *STRTAB_HASH_TO_SLOT(&ZCSG(interned_strings), h);
598597
if (EXPECTED(pos != STRTAB_INVALID_POS)) {
599598
do {
600-
s = STRTAB_POS_TO_STR(&ZCSG(interned_strings), pos);
599+
zend_string *s = STRTAB_POS_TO_STR(&ZCSG(interned_strings), pos);
601600
if (EXPECTED(ZSTR_H(s) == h) && zend_string_equals_cstr(s, str, size)) {
602601
return s;
603602
}
@@ -720,14 +719,13 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
720719
Z_FUNC(q->val)->common.function_name = new_interned_string(Z_FUNC(q->val)->common.function_name);
721720
}
722721
if (Z_FUNC(q->val)->common.scope == ce) {
723-
uint32_t i;
724722
uint32_t num_args = Z_FUNC(q->val)->common.num_args + 1;
725723
zend_arg_info *arg_info = Z_FUNC(q->val)->common.arg_info - 1;
726724

727725
if (Z_FUNC(q->val)->common.fn_flags & ZEND_ACC_VARIADIC) {
728726
num_args++;
729727
}
730-
for (i = 0 ; i < num_args; i++) {
728+
for (uint32_t i = 0 ; i < num_args; i++) {
731729
if (i > 0) {
732730
arg_info[i].name = new_interned_string(arg_info[i].name);
733731
if (arg_info[i].default_value) {
@@ -2341,7 +2339,6 @@ static zend_always_inline zend_inheritance_cache_entry* zend_accel_inheritance_c
23412339

23422340
static zend_class_entry* zend_accel_inheritance_cache_get(zend_class_entry *ce, zend_class_entry *parent, zend_class_entry **traits_and_interfaces)
23432341
{
2344-
uint32_t i;
23452342
bool needs_autoload;
23462343
zend_inheritance_cache_entry *entry = ce->inheritance_cache;
23472344

@@ -2360,7 +2357,7 @@ static zend_class_entry* zend_accel_inheritance_cache_get(zend_class_entry *ce,
23602357
return ce;
23612358
}
23622359

2363-
for (i = 0; i < entry->dependencies_count; i++) {
2360+
for (uint32_t i = 0; i < entry->dependencies_count; i++) {
23642361
zend_class_entry *ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, 0);
23652362

23662363
if (ce == NULL) {
@@ -3925,10 +3922,9 @@ static bool preload_try_resolve_constants(zend_class_entry *ce)
39253922
ce->ce_flags &= ~ZEND_ACC_HAS_AST_CONSTANTS;
39263923
}
39273924
if (ce->default_properties_count) {
3928-
uint32_t i;
39293925
bool resolved = true;
39303926

3931-
for (i = 0; i < ce->default_properties_count; i++) {
3927+
for (uint32_t i = 0; i < ce->default_properties_count; i++) {
39323928
zend_property_info *prop = ce->properties_info_table[i];
39333929
if (!prop) {
39343930
continue;

0 commit comments

Comments
 (0)