Lines Matching refs:key

175 static inline bool implements_hashable(zval *key) {  in implements_hashable()  argument
176 return Z_TYPE_P(key) == IS_OBJECT && instanceof_function(Z_OBJCE_P(key), hashable_ce); in implements_hashable()
195 static inline bool key_is_identical(zval *key, zval *other) in key_is_identical() argument
197 if (Z_TYPE_P(key) == IS_OBJECT && implements_hashable(key)) { in key_is_identical()
198 return Z_TYPE_P(other) == IS_OBJECT && user_hashable_equals(key, other); in key_is_identical()
201 return zend_is_identical(key, other); in key_is_identical()
204 static inline bool ds_htable_bucket_key_match(ds_htable_bucket_t *bucket, zval *key) in ds_htable_bucket_key_match() argument
206 return key_is_identical(&bucket->key, key); in ds_htable_bucket_key_match()
341 zval *key, in ds_htable_lookup_bucket_by_hash() argument
358 if (ds_htable_bucket_key_match(bucket, key)) { in ds_htable_lookup_bucket_by_hash()
367 ds_htable_bucket_t *ds_htable_lookup_by_key(ds_htable_t *table, zval *key) in ds_htable_lookup_by_key() argument
369 return ds_htable_lookup_bucket_by_hash(table, key, get_hash(key)); in ds_htable_lookup_by_key()
429 bool ds_htable_isset(ds_htable_t *table, zval *key, bool check_empty) in ds_htable_isset() argument
431 ds_htable_bucket_t *bucket = ds_htable_lookup_by_key(table, key); in ds_htable_isset()
436 zval *ds_htable_get(ds_htable_t *table, zval *key) in ds_htable_get() argument
438 ds_htable_bucket_t *bucket = ds_htable_lookup_by_key(table, key); in ds_htable_get()
443 bool ds_htable_has_key(ds_htable_t *table, zval *key) in ds_htable_has_key() argument
445 return ds_htable_lookup_by_key(table, key) != NULL; in ds_htable_has_key()
658 zval *key, in ds_htable_init_next_bucket() argument
666 ZVAL_COPY(&bucket->key, key); in ds_htable_init_next_bucket()
680 bool ds_htable_lookup_or_next(ds_htable_t *table, zval *key, ds_htable_bucket_t **bucket) in ds_htable_lookup_or_next() argument
682 const uint32_t hash = get_hash(key); in ds_htable_lookup_or_next()
685 if ((*bucket = ds_htable_lookup_bucket_by_hash(table, key, hash))) { in ds_htable_lookup_or_next()
694 *bucket = ds_htable_init_next_bucket(table, key, NULL, hash); in ds_htable_lookup_or_next()
698 void ds_htable_put(ds_htable_t *table, zval *key, zval *value) in ds_htable_put() argument
703 bool found = ds_htable_lookup_or_next(table, key, &bucket); in ds_htable_put()
767 return zval_get_string(&ds_htable_last(table)->key); in ds_htable_join_keys()
775 smart_str_appendz(&str, &pos->key); in ds_htable_join_keys()
781 smart_str_appendz(&str, &end->key); in ds_htable_join_keys()
785 zval *key; in ds_htable_join_keys() local
786 DS_HTABLE_FOREACH_KEY(table, key) { in ds_htable_join_keys()
787 smart_str_appendz(&str, key); in ds_htable_join_keys()
796 int ds_htable_remove(ds_htable_t *table, zval *key, zval *return_value) in ds_htable_remove() argument
798 uint32_t hash = get_hash(key); in ds_htable_remove()
807 if (DS_HTABLE_BUCKET_HASH(bucket) != hash || ! ds_htable_bucket_key_match(bucket, key)) { in ds_htable_remove()
878 slice, &src->key, &src->value, DS_HTABLE_BUCKET_HASH(src)); in ds_htable_slice()
890 slice, &src->key, &src->value, DS_HTABLE_BUCKET_HASH(src)); in ds_htable_slice()
922 slice, &src->key, &src->value, DS_HTABLE_BUCKET_HASH(src)); in ds_htable_slice()
971 mapped, &bucket->key, &retval, DS_HTABLE_BUCKET_HASH(bucket)); in ds_htable_map()
989 &bucket->key, in ds_htable_filter()
1020 filtered, &src->key, &src->value, DS_HTABLE_BUCKET_HASH(src)); in ds_htable_filter_callback()
1032 zval *key, *value; in ds_htable_reduce() local
1042 DS_HTABLE_FOREACH_KEY_VALUE(table, key, value) { in ds_htable_reduce()
1044 ZVAL_COPY_VALUE(&params[1], key); in ds_htable_reduce()
1068 if ( ! ds_htable_has_key(other, &bucket->key)) { in ds_htable_xor()
1075 if ( ! ds_htable_has_key(table, &bucket->key)) { in ds_htable_xor()
1090 if ( ! ds_htable_has_key(other, &bucket->key)) { in ds_htable_diff()
1106 if (ds_htable_has_key(other, &bucket->key)) { in ds_htable_intersect()
1121 ds_htable_put(merged, &bucket->key, &bucket->value); in ds_htable_merge()
1170 zval *key; in ds_htable_to_array() local
1176 DS_HTABLE_FOREACH_KEY_VALUE(table, key, val) { in ds_htable_to_array()
1177 array_set_zval_key(array, key, val); in ds_htable_to_array()
1191 zval *key, *value; in ds_htable_serialize() local
1195 DS_HTABLE_FOREACH_KEY_VALUE(table, key, value) { in ds_htable_serialize()
1196 php_var_serialize(&buf, key, &serialize_data); in ds_htable_serialize()
1222 zval *key = var_tmp_var(&unserialize_data); in ds_htable_unserialize() local
1225 if (php_var_unserialize(key, &pos, end, &unserialize_data)) { in ds_htable_unserialize()
1226 var_push_dtor(&unserialize_data, key); in ds_htable_unserialize()
1237 ds_htable_put(table, key, value); in ds_htable_unserialize()