projects
/
m6w6
/
ext-pq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
90fc98e
)
simplify
author
Michael Wallner
<mike@php.net>
Wed, 17 Dec 2014 07:39:12 +0000
(08:39 +0100)
committer
Michael Wallner
<mike@php.net>
Wed, 17 Dec 2014 07:39:12 +0000
(08:39 +0100)
src/php_pqstm.c
patch
|
blob
|
history
diff --git
a/src/php_pqstm.c
b/src/php_pqstm.c
index 0dd2ebc50cd2532e027ef94762e9ce2f2e4ed8b8..d360d0dc97450dc0f823bb55014d2aa12f3cfc5a 100644
(file)
--- a/
src/php_pqstm.c
+++ b/
src/php_pqstm.c
@@
-140,19
+140,12
@@
static void php_pqstm_object_read_query(zval *object, void *o, zval *return_valu
RETVAL_STRING(obj->intern->query, 1);
}
RETVAL_STRING(obj->intern->query, 1);
}
-static void php_pqstm_object_read_types(zval *object, void *o, zval *return_value)
+static void php_pqstm_object_read_types(zval *object, void *o, zval *return_value
TSRMLS_DC
)
{
int i;
{
int i;
- HashTable *ht;
- php_pqstm_object_t *obj;
-
- obj = (php_pqstm_object_t *)o;
- ht = (HashTable *)emalloc(sizeof(HashTable));
-
- zend_hash_init(ht, obj->intern->params->type.count, NULL, ZVAL_PTR_DTOR, 0);
- Z_TYPE_P(return_value) = IS_ARRAY;
- Z_ARRVAL_P(return_value) = ht;
+ php_pqstm_object_t *obj = o;
+ array_init_size(return_value, obj->intern->params->type.count);
for (i = 0; i < obj->intern->params->type.count; i++) {
add_next_index_long(return_value, (long)obj->intern->params->type.oids[i]);
}
for (i = 0; i < obj->intern->params->type.count; i++) {
add_next_index_long(return_value, (long)obj->intern->params->type.oids[i]);
}