-static inline const char *php_http_locate_str(const char *h, size_t h_len, const char *n, size_t n_len)
+/* See "A Reusable Duff Device" By Ralf Holly, August 01, 2005 */
+#define PHP_HTTP_DUFF_BREAK() times_=1
+#define PHP_HTTP_DUFF(c, a) do { \
+ size_t count_ = (c); \
+ size_t times_ = (count_ + 7) >> 3; \
+ switch (count_ & 7){ \
+ case 0: do { \
+ a; \
+ case 7: \
+ a; \
+ case 6: \
+ a; \
+ case 5: \
+ a; \
+ case 4: \
+ a; \
+ case 3: \
+ a; \
+ case 2: \
+ a; \
+ case 1: \
+ a; \
+ } while (--times_ > 0); \
+ } \
+} while (0)
+
+static inline const char *php_http_locate_str(register const char *h, size_t h_len, const char *n, size_t n_len)