summaryrefslogtreecommitdiff
path: root/Zend/zend_ts_hash.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-09-19 13:55:53 +0300
committerDmitry Stogov <dmitry@zend.com>2018-09-19 13:55:53 +0300
commit27b0fecd2e0192290d6530ea1ee2f5cd23e43682 (patch)
tree408a78b17d0fbd61b1151b16d06fb46d6d2a14a0 /Zend/zend_ts_hash.h
parent6beaa9fa5b9764b411a178395ba26b237debf9fd (diff)
downloadphp-git-27b0fecd2e0192290d6530ea1ee2f5cd23e43682.tar.gz
Turn zend_hash_exists() into inline function
Diffstat (limited to 'Zend/zend_ts_hash.h')
-rw-r--r--Zend/zend_ts_hash.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h
index 91840f203f..c05f073e60 100644
--- a/Zend/zend_ts_hash.h
+++ b/Zend/zend_ts_hash.h
@@ -68,10 +68,6 @@ ZEND_API int zend_ts_hash_index_del(TsHashTable *ht, zend_ulong h);
ZEND_API zval *zend_ts_hash_find(TsHashTable *ht, zend_string *key);
ZEND_API zval *zend_ts_hash_index_find(TsHashTable *ht, zend_ulong);
-/* Misc */
-ZEND_API int zend_ts_hash_exists(TsHashTable *ht, zend_string *key);
-ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, zend_ulong h);
-
/* Copying, merging and sorting */
ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor);
ZEND_API void zend_ts_hash_copy_to_hash(HashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor);
@@ -121,6 +117,16 @@ static zend_always_inline void *zend_ts_hash_str_add_ptr(TsHashTable *ht, const
return zv ? Z_PTR_P(zv) : NULL;
}
+static zend_always_inline int zend_ts_hash_exists(TsHashTable *ht, zend_string *key)
+{
+ return zend_ts_hash_find(ht, key) != NULL;
+}
+
+static zend_always_inline int zend_ts_hash_index_exists(TsHashTable *ht, zend_ulong h)
+{
+ return zend_ts_hash_index_find(ht, h) != NULL;
+}
+
END_EXTERN_C()
#define ZEND_TS_INIT_SYMTABLE(ht) \