Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 06ecacd

Browse files
author
Neil Conway
committed
More trivial dead code removal: in int_to_roman(), checking for "num == -1"
is redundant after a check has already been made for "num < 0". The "set" variable can also be removed, as it is now no longer used. Per checking with Karel, this is the right fix. Per Coverity static analysis performed by EnterpriseDB.
1 parent ebcb4c9 commit 06ecacd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/backend/utils/adt/formatting.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.88 2005/06/15 00:34:08 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.89 2005/06/22 01:43:05 neilc Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2005, PostgreSQL Global Development Group
@@ -3508,8 +3508,7 @@ static char *
35083508
int_to_roman(int number)
35093509
{
35103510
int len = 0,
3511-
num = 0,
3512-
set = 0;
3511+
num = 0;
35133512
char *p = NULL,
35143513
*result,
35153514
numstr[5];
@@ -3529,9 +3528,6 @@ int_to_roman(int number)
35293528
num = *p - 49; /* 48 ascii + 1 */
35303529
if (num < 0)
35313530
continue;
3532-
if (num == -1 && set == 0)
3533-
continue;
3534-
set = 1;
35353531

35363532
if (len > 3)
35373533
{

0 commit comments

Comments
 (0)