Skip to content

Redundant aliases checks in _php_ibase_fetch_hash() #81

@mlazdans

Description

@mlazdans

No need to check aliases on each fetch iteration. Should be checked only once per statement.

php-firebird/ibase_query.c

Lines 1694 to 1711 in 4d808e9

/**
* Ensure no two columns have identical names:
* keep generating new names until we find one that is unique.
*/
switch (*alias) {
void *p;
default:
i = 1;
base = alias;
while ((p = zend_symtable_str_find_ptr(
Z_ARRVAL_P(return_value), alias, strlen(alias))) != NULL) {
case '\0':
snprintf(alias = buf, sizeof(buf), "%s_%02d", base, i++);
}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions