cvs: ZendEngine2(PHP_5_3) / zend_operators.h
| From: | Scott MacVicar | Date: | Mon, 21 Jul 2008 18:47:02 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_3) / zend_operators.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-6910@lists.php.net to get a copy of this message | ||
scottmac Mon Jul 21 18:47:02 2008 UTC
Modified files: (Branch: PHP_5_3)
/ZendEngine2 zend_operators.h
Log:
Optimisation for zend_memnstr when the needle is only a single character. (Patch by Michal
Dziemianko - GSoC08)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.h?r1=1.94.2.4.2.10.2.7&r2=1.94.2.4.2.10.2.8&diff_format=u
Index: ZendEngine2/zend_operators.h
diff -u ZendEngine2/zend_operators.h:1.94.2.4.2.10.2.7
ZendEngine2/zend_operators.h:1.94.2.4.2.10.2.8
--- ZendEngine2/zend_operators.h:1.94.2.4.2.10.2.7 Wed Mar 19 12:44:13 2008
+++ ZendEngine2/zend_operators.h Mon Jul 21 18:47:02 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.h,v 1.94.2.4.2.10.2.7 2008/03/19 12:44:13 tony2001 Exp $ */
+/* $Id: zend_operators.h,v 1.94.2.4.2.10.2.8 2008/07/21 18:47:02 scottmac Exp $ */
#ifndef ZEND_OPERATORS_H
#define ZEND_OPERATORS_H
@@ -220,6 +220,10 @@
char *p = haystack;
char ne = needle[needle_len-1];
+ if (needle_len == 1) {
+ return (char *)memchr(p, *needle, (end-p));
+ }
+
end -= needle_len;
while (p <= end) {