From 90f43c78b0737a2aa35f3b81a0279170705b6ec1 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sat, 8 Jun 2002 13:01:05 +0000 Subject: [PATCH] - This should improve performance on Windows --- Zend/zend.h | 22 ++++++++++++---------- Zend/zend_hash.h | 4 +++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index 237a8141bb..82e8c186c0 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -54,6 +54,18 @@ # define ZEND_PATHS_SEPARATOR ':' #endif + +#ifdef ZEND_WIN32 +/* Only use this macro if you know for sure that all of the switches values + are covered by its case statements */ +#define EMPTY_SWITCH_DEFAULT_CASE() \ + default: \ + __assume(0); \ + break; +#else +#define EMPTY_SWITCH_DEFAULT_CASE() +#endif + /* all HAVE_XXX test have to be after the include of zend_config above */ #ifdef HAVE_UNIX_H @@ -541,16 +553,6 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval #define ZEND_MAX_RESERVED_RESOURCES 4 -#ifdef ZEND_WIN32 -/* Only use this macro if you know for sure that all of the switches values - are covered by its case statements */ -#define EMPTY_SWITCH_DEFAULT_CASE() \ - default: \ - __assume(0); \ - break; -#else -#define EMPTY_SWITCH_DEFAULT_CASE() -#endif #endif /* ZEND_H */ diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 479d69a649..46d1fb994d 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -21,6 +21,7 @@ #define ZEND_HASH_H #include +#include "zend.h" #define HASH_KEY_IS_STRING 1 #define HASH_KEY_IS_LONG 2 @@ -244,7 +245,8 @@ static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength) case 3: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */ case 2: hash = ((hash << 5) + hash) + *arKey++; /* fallthrough... */ case 1: hash = ((hash << 5) + hash) + *arKey++; break; - default: /* case 0: */ break; + case 0: break; +EMPTY_SWITCH_DEFAULT_CASE() } return hash; } -- 2.40.0