]> granicus.if.org Git - php/commitdiff
Small optimization
authorZeev Suraski <zeev@php.net>
Fri, 2 Jun 2000 12:24:24 +0000 (12:24 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 2 Jun 2000 12:24:24 +0000 (12:24 +0000)
ext/standard/math.c

index 5663634e02b98f9b9a8a7eaf16f5cf178c5e61b7..fef8cf038832732867db0314cdd87fd1c85f2e1f 100644 (file)
@@ -636,9 +636,12 @@ char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep)
                return tmpbuf;
        }
 
-       for (t=tmpbuf; *t; t++) {
-               if (*t=='.') {
-                       *t = dec_point;
+       if (dec_point!='.') {
+               for (t=tmpbuf; *t; t++) {
+                       if (*t=='.') {
+                               *t = dec_point;
+                               break;
+                       }
                }
        }
        if (dec) {