Skip to content

Commit 345d229

Browse files
committed
ext/dba: Reduce scope of dba_handler variables
1 parent 076811a commit 345d229

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/dba/dba.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,9 @@ PHP_MSHUTDOWN_FUNCTION(dba)
435435
/* {{{ PHP_MINFO_FUNCTION */
436436
PHP_MINFO_FUNCTION(dba)
437437
{
438-
const dba_handler *hptr;
439438
smart_str handlers = {0};
440439

441-
for(hptr = handler; hptr->name; hptr++) {
440+
for (const dba_handler *hptr = handler; hptr->name; hptr++) {
442441
smart_str_appends(&handlers, hptr->name);
443442
smart_str_appendc(&handlers, ' ');
444443
}
@@ -1252,7 +1251,6 @@ PHP_FUNCTION(dba_sync)
12521251
/* {{{ List configured database handlers */
12531252
PHP_FUNCTION(dba_handlers)
12541253
{
1255-
const dba_handler *hptr;
12561254
bool full_info = 0;
12571255

12581256
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) {
@@ -1261,7 +1259,7 @@ PHP_FUNCTION(dba_handlers)
12611259

12621260
array_init(return_value);
12631261

1264-
for(hptr = handler; hptr->name; hptr++) {
1262+
for (const dba_handler *hptr = handler; hptr->name; hptr++) {
12651263
if (full_info) {
12661264
// TODO: avoid reallocation ???
12671265
char *str = hptr->info(hptr, NULL);

0 commit comments

Comments
 (0)