]> granicus.if.org Git - php/commitdiff
- This should improve performance on Windows
authorAndi Gutmans <andi@php.net>
Sat, 8 Jun 2002 13:01:05 +0000 (13:01 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 8 Jun 2002 13:01:05 +0000 (13:01 +0000)
Zend/zend.h
Zend/zend_hash.h

index 237a8141bb55f7860c1e4cd44b0e5bb4b917a7fc..82e8c186c07edb90192688b675700bb38b5ff318 100644 (file)
 # 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 */
 
index 479d69a6491bed7a41bea2fd069b2e352c032d11..46d1fb994df1cca57c342e0366c475ce67696dc8 100644 (file)
@@ -21,6 +21,7 @@
 #define ZEND_HASH_H
 
 #include <sys/types.h>
+#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;
 }