Skip to content

Commit 953e977

Browse files
j-naylorpull[bot]
authored andcommitted
Remove dead code in formatting.c
Remove some code guarded by IS_MINUS() or IS_PLUS(), where the entire stanza is inside an else-block where both of these are false. This should slightly improve test coverage. While at it, remove coding that apparently assumes that unsetting a bit is so expensive that we have to first check if it's already set in the first place. Per Coverity report from Ranier Vilela Analysis and review by Justin Pryzby Discussion: https://www.postgresql.org/message-id/20221223010818.GP1153%40telsasoft.com
1 parent 4b939bd commit 953e977

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,13 +5664,9 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout,
56645664
{
56655665
if (Np->sign != '-')
56665666
{
5667-
if (IS_BRACKET(Np->Num) && IS_FILLMODE(Np->Num))
5667+
if (IS_FILLMODE(Np->Num))
56685668
Np->Num->flag &= ~NUM_F_BRACKET;
5669-
if (IS_MINUS(Np->Num))
5670-
Np->Num->flag &= ~NUM_F_MINUS;
56715669
}
5672-
else if (Np->sign != '+' && IS_PLUS(Np->Num))
5673-
Np->Num->flag &= ~NUM_F_PLUS;
56745670

56755671
if (Np->sign == '+' && IS_FILLMODE(Np->Num) && IS_LSIGN(Np->Num) == false)
56765672
Np->sign_wrote = true; /* needn't sign */

0 commit comments

Comments
 (0)