From dc47171523b70112b14cf9144bdf223e9db550fe Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 11 Dec 2017 18:18:30 +0300 Subject: Avoid temporary string creation and destruction. --- Zend/zend_ini.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Zend/zend_ini.c') diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 129c782499..cb711cbaeb 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -496,6 +496,19 @@ ZEND_API char *zend_ini_string(char *name, size_t name_length, int orig) /* {{{ } /* }}} */ +ZEND_API zend_string *zend_ini_get_value(zend_string *name) /* {{{ */ +{ + zend_ini_entry *ini_entry; + + ini_entry = zend_hash_find_ptr(EG(ini_directives), name); + if (ini_entry) { + return ini_entry->value ? ini_entry->value : ZSTR_EMPTY_ALLOC(); + } else { + return NULL; + } +} +/* }}} */ + #if TONY_20070307 static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ */ { -- cgit v1.2.1