p = p->pNext;
}
- p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent);
+ p = (Bucket *) pemalloc(sizeof(Bucket) - 1 + nKeyLength, ht->persistent);
if (!p) {
return FAILURE;
}
p = p->pNext;
}
- p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent);
+ p = (Bucket *) pemalloc(sizeof(Bucket) - 1 + nKeyLength, ht->persistent);
if (!p) {
return FAILURE;
}
}
p = p->pNext;
}
- p = (Bucket *) pemalloc_rel(sizeof(Bucket)-1, ht->persistent);
+ p = (Bucket *) pemalloc_rel(sizeof(Bucket) - 1, ht->persistent);
if (!p) {
return FAILURE;
}
- p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */
+ p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */
p->h = h;
INIT_DATA(ht, p, pData, nDataSize);
if (pDest) {
} else {
zend_hash_index_update(target, p->h, p->pData, size, &new_entry);
}
- if (pCopyConstructor) {
- pCopyConstructor(new_entry);
- }
+ if (pCopyConstructor) {
+ pCopyConstructor(new_entry);
+ }
p = p->pListNext;
}
target->pInternalPointer = target->pListHead;
IS_CONSISTENT(source);
IS_CONSISTENT(target);
- p = source->pListHead;
+ p = source->pListHead;
while (p) {
if (p->nKeyLength>0) {
if (_zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) {
IS_CONSISTENT(source);
IS_CONSISTENT(target);
- p = source->pListHead;
+ p = source->pListHead;
while (p) {
if (zend_hash_replace_checker_wrapper(target, p->pData, p, pParam, pMergeSource)) {
if (zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos)
{
Bucket *p;
-
+
p = pos ? (*pos) : ht->pInternalPointer;
IS_CONSISTENT(ht);
if (p) {
if (p->nKeyLength) {
if (duplicate) {
- *str_index = estrndup(p->arKey, p->nKeyLength-1);
+ *str_index = estrndup(p->arKey, p->nKeyLength - 1);
} else {
*str_index = p->arKey;
}
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
{
Bucket *p;
-
+
p = pos ? (*pos) : ht->pInternalPointer;
IS_CONSISTENT(ht);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos)
{
Bucket *p;
-
+
p = pos ? (*pos) : ht->pInternalPointer;
IS_CONSISTENT(ht);
arTmp[0]->pListLast = NULL;
if (i > 1) {
- arTmp[0]->pListNext = arTmp[1];
- for (j = 1; j < i-1; j++) {
- arTmp[j]->pListLast = arTmp[j-1];
- arTmp[j]->pListNext = arTmp[j+1];
- }
- arTmp[j]->pListLast = ht->pListTail;
- arTmp[j]->pListNext = NULL;
- } else {
- arTmp[0]->pListNext = NULL;
- }
- ht->pListTail = arTmp[i-1];
+ arTmp[0]->pListNext = arTmp[1];
+ for (j = 1; j < i-1; j++) {
+ arTmp[j]->pListLast = arTmp[j-1];
+ arTmp[j]->pListNext = arTmp[j+1];
+ }
+ arTmp[j]->pListLast = ht->pListTail;
+ arTmp[j]->pListNext = NULL;
+ } else {
+ arTmp[0]->pListNext = NULL;
+ }
+ ht->pListTail = arTmp[i-1];
pefree(arTmp, ht->persistent);
HANDLE_UNBLOCK_INTERRUPTIONS();