From ab36e22aebb8c87cf38d4f1dd78ea7d0682284a1 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Fri, 2 Jun 2000 12:24:24 +0000 Subject: [PATCH] Small optimization --- ext/standard/math.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/standard/math.c b/ext/standard/math.c index 5663634e02..fef8cf0388 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -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) { -- 2.50.1