logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: ZendEngine2(PHP_5_2) / zend_operators.c zend_operators.h: msg#00027

Subject: cvs: ZendEngine2(PHP_5_2) / zend_operators.c zend_operators.h
iliaa           Mon Dec 11 15:16:07 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /ZendEngine2        zend_operators.h zend_operators.c 
  Log:
  Minor optimization (2-3%) from Brian Shire
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.h?r1=1.94.2.4.2.5&r2=1.94.2.4.2.6&diff_format=u
Index: ZendEngine2/zend_operators.h
diff -u ZendEngine2/zend_operators.h:1.94.2.4.2.5 
ZendEngine2/zend_operators.h:1.94.2.4.2.6
--- ZendEngine2/zend_operators.h:1.94.2.4.2.5   Mon Dec  4 18:34:47 2006
+++ ZendEngine2/zend_operators.h        Mon Dec 11 15:16:07 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_operators.h,v 1.94.2.4.2.5 2006/12/04 18:34:47 stas Exp $ */
+/* $Id: zend_operators.h,v 1.94.2.4.2.6 2006/12/11 15:16:07 iliaa Exp $ */
 
 #ifndef ZEND_OPERATORS_H
 #define ZEND_OPERATORS_H
@@ -200,7 +200,7 @@
 ZEND_API void multi_convert_to_string_ex(int argc, ...);
 ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
 ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
-#define convert_to_string(op)                  _convert_to_string((op) 
ZEND_FILE_LINE_CC)
+#define convert_to_string(op) if ((op)->type != IS_STRING) { 
_convert_to_string((op) ZEND_FILE_LINE_CC); }
 
 ZEND_API double zend_string_to_double(const char *number, zend_uint length);
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_operators.c?r1=1.208.2.4.2.12&r2=1.208.2.4.2.13&diff_format=u
Index: ZendEngine2/zend_operators.c
diff -u ZendEngine2/zend_operators.c:1.208.2.4.2.12 
ZendEngine2/zend_operators.c:1.208.2.4.2.13
--- ZendEngine2/zend_operators.c:1.208.2.4.2.12 Mon Dec  4 18:34:47 2006
+++ ZendEngine2/zend_operators.c        Mon Dec 11 15:16:07 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_operators.c,v 1.208.2.4.2.12 2006/12/04 18:34:47 stas Exp $ */
+/* $Id: zend_operators.c,v 1.208.2.4.2.13 2006/12/11 15:16:07 iliaa Exp $ */
 
 #include <ctype.h>
 
@@ -304,13 +304,13 @@
                }                                                               
                                                                                
                        \
        }
 
-
 ZEND_API void convert_to_long(zval *op)
 {
-       convert_to_long_base(op, 10);
+       if ((op)->type != IS_BOOL && (op)->type != IS_LONG) {
+               convert_to_long_base(op, 10);
+       }
 }
 
-
 ZEND_API void convert_to_long_base(zval *op, int base)
 {
        char *strval;
@@ -1175,11 +1175,14 @@
 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
 {
        zval op1_copy, op2_copy;
-       int use_copy1, use_copy2;
-
+       int use_copy1 = 0, use_copy2 = 0;
 
-       zend_make_printable_zval(op1, &op1_copy, &use_copy1);
-       zend_make_printable_zval(op2, &op2_copy, &use_copy2);
+       if (op1->type != IS_STRING) {
+               zend_make_printable_zval(op1, &op1_copy, &use_copy1);
+       }
+       if (op2->type != IS_STRING) {
+               zend_make_printable_zval(op2, &op2_copy, &use_copy2);
+       }
 
        if (use_copy1) {
                /* We have created a converted copy of op1. Therefore, op1 
won't become the result so

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>