Slow
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
https://github.com/facebook/hhvm/blob/2213d8acd42464bfae0a8dc96a16b2092c22ba1d/hphp/runtime/ext/mysql/mysql_common.cpp#L1411
In each iteration -> getFieldCount() and checking result type
Maybe:
```c
// 1411
int fieldCound = res->getFieldCount();
if (fieldCound == 0) {
return ret; //Return array() in cases when no data present
}
if (result_type & PHP_MYSQL_NUM) {
for (int i = 0; i < fieldCound; i++) {
ret.set(i, res->getField(i));
}
} else if (result_type & PHP_MYSQL_ASSOC) {
for (int i = 0; i < fieldCound; i++) {
MySQLFieldInfo *info = res->getFieldInfo(i);
auto const arrkey =
ret.convertKey(info->name);
ret.set(arrkey, *res->getField(i).asTypedValue());
}
}
// 1421
```
Contributor guide
Assessment
This issue has not been assessed yet.