summaryrefslogtreecommitdiff
path: root/Zend/zend_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_hash.h
parent6beaa9fa5b9764b411a178395ba26b237debf9fd (diff)
downloadphp-git-27b0fecd2e0192290d6530ea1ee2f5cd23e43682.tar.gz
Turn zend_hash_exists() into inline function
Diffstat (limited to 'Zend/zend_hash.h')
-rw-r--r--Zend/zend_hash.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 7f53003ae8..1ef4e974ab 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -199,9 +199,20 @@ static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_stri
/* Misc */
-ZEND_API zend_bool ZEND_FASTCALL zend_hash_exists(const HashTable *ht, zend_string *key);
-ZEND_API zend_bool ZEND_FASTCALL zend_hash_str_exists(const HashTable *ht, const char *str, size_t len);
-ZEND_API zend_bool ZEND_FASTCALL zend_hash_index_exists(const HashTable *ht, zend_ulong h);
+static zend_always_inline zend_bool zend_hash_exists(const HashTable *ht, zend_string *key)
+{
+ return zend_hash_find(ht, key) != NULL;
+}
+
+static zend_always_inline zend_bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t len)
+{
+ return zend_hash_str_find(ht, str, len) != NULL;
+}
+
+static zend_always_inline zend_bool zend_hash_index_exists(const HashTable *ht, zend_ulong h)
+{
+ return zend_hash_index_find(ht, h) != NULL;
+}
/* traversing */
ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht);