Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91da65f

Browse files
committed
Remove a couple of unnecessary if-tests.
Commitabd9ca3 replaced a couple of while-loops in fmtfloat()with calls to dopr_outchmulti, but I (tgl) failed to notice thatthe new if-tests guarding those calls were really unnecessary,because they're inside a larger if-block checking the same thing.Ranier VilelaDiscussion:https://postgr.es/m/MN2PR18MB2927850AB00CF39CC370D107E34B0@MN2PR18MB2927.namprd18.prod.outlook.com
1 parent45ff049 commit91da65f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎src/port/snprintf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,16 +1227,14 @@ fmtfloat(double value, char type, int forcesign, int leftjust,
12271227
{
12281228
/* pad before exponent */
12291229
dostr(convert,epos-convert,target);
1230-
if (zeropadlen>0)
1231-
dopr_outchmulti('0',zeropadlen,target);
1230+
dopr_outchmulti('0',zeropadlen,target);
12321231
dostr(epos,vallen- (epos-convert),target);
12331232
}
12341233
else
12351234
{
12361235
/* no exponent, pad after the digits */
12371236
dostr(convert,vallen,target);
1238-
if (zeropadlen>0)
1239-
dopr_outchmulti('0',zeropadlen,target);
1237+
dopr_outchmulti('0',zeropadlen,target);
12401238
}
12411239
}
12421240
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp