iliaa           Wed Oct 20 18:44:43 2004 EDT

  Modified files:              
    /php-src/ext/standard       string.c 
  Log:
  Slight optimization in str_split() when split length is the same or greater
  then the string length.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.423&r2=1.424&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.423 php-src/ext/standard/string.c:1.424
--- php-src/ext/standard/string.c:1.423 Thu Oct  7 19:10:35 2004
+++ php-src/ext/standard/string.c       Wed Oct 20 18:44:43 2004
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.423 2004/10/07 23:10:35 iliaa Exp $ */
+/* $Id: string.c,v 1.424 2004/10/20 22:44:43 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4782,6 +4782,11 @@
 
        array_init(return_value);
 
+       if (split_length >= str_len) {
+               add_next_index_stringl(return_value, str, str_len, 1);
+               return;
+       }
+
        n_reg_segments = floor(str_len / split_length);
        p = str;
 

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

Reply via email to