cvs: ZendEngine2 / zend_operators.h

From: Date: Mon, 21 Jul 2008 18:43:46 +0000
Subject: cvs: ZendEngine2 / zend_operators.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6909@lists.php.net to get a copy of this message
scottmac Mon Jul 21 18:43:46 2008 UTC Modified files: /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.129&r2=1.130&diff_format=u Index: ZendEngine2/zend_operators.h diff -u ZendEngine2/zend_operators.h:1.129 ZendEngine2/zend_operators.h:1.130 --- ZendEngine2/zend_operators.h:1.129 Wed Mar 19 12:44:05 2008 +++ ZendEngine2/zend_operators.h Mon Jul 21 18:43:46 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_operators.h,v 1.129 2008/03/19 12:44:05 tony2001 Exp $ */ +/* $Id: zend_operators.h,v 1.130 2008/07/21 18:43:46 scottmac Exp $ */ #ifndef ZEND_OPERATORS_H #define ZEND_OPERATORS_H @@ -231,6 +231,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) {

« previous php.zend-engine.cvs (#6909) next »