cvs: ZendEngine2(PHP_5_3) / zend_operators.h
"Scott MacVicar" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.zend |
|---|---|
| Message-ID | <cvsscottmac1216666022@cvsserver> |
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) {
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php