aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2005-06-22 01:43:05 +0000
committerNeil Conway <neilc@samurai.com>2005-06-22 01:43:05 +0000
commit06ecacded604d6d04b77e119a87a78f759b6b171 (patch)
treee7344d60a3d740154a16f0c6d8a9db8b059a1ea8
parentebcb4c931dc0ea5bc5e2199f39996f99fcab842b (diff)
downloadpostgresql-06ecacded604d6d04b77e119a87a78f759b6b171.tar.gz
postgresql-06ecacded604d6d04b77e119a87a78f759b6b171.zip
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.
-rw-r--r--src/backend/utils/adt/formatting.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index e4de64444ea..9b64dab8ea0 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.88 2005/06/15 00:34:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.89 2005/06/22 01:43:05 neilc Exp $
*
*
* Portions Copyright (c) 1999-2005, PostgreSQL Global Development Group
@@ -3508,8 +3508,7 @@ static char *
int_to_roman(int number)
{
int len = 0,
- num = 0,
- set = 0;
+ num = 0;
char *p = NULL,
*result,
numstr[5];
@@ -3529,9 +3528,6 @@ int_to_roman(int number)
num = *p - 49; /* 48 ascii + 1 */
if (num < 0)
continue;
- if (num == -1 && set == 0)
- continue;
- set = 1;
if (len > 3)
{