Skip to content

Commit 348f1d4

Browse files
committed
SQL,refactor: use ternary operators
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 629c172 commit 348f1d4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

parsers/sql.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,14 +1530,7 @@ static void parseDeclare (tokenInfo *const token, const bool local)
15301530
default:
15311531
if (isType (token, TOKEN_IDENTIFIER))
15321532
{
1533-
if (local)
1534-
{
1535-
makeSqlTag (token, SQLTAG_LOCAL_VARIABLE);
1536-
}
1537-
else
1538-
{
1539-
makeSqlTag (token, SQLTAG_VARIABLE);
1540-
}
1533+
makeSqlTag (token, local? SQLTAG_LOCAL_VARIABLE: SQLTAG_VARIABLE);
15411534
}
15421535
break;
15431536
}
@@ -1590,10 +1583,7 @@ static void parseDeclareANSI (tokenInfo *const token, const bool local)
15901583
else if (isType (token, TOKEN_IDENTIFIER) ||
15911584
isType (token, TOKEN_STRING))
15921585
{
1593-
if (local)
1594-
makeSqlTag (token, SQLTAG_LOCAL_VARIABLE);
1595-
else
1596-
makeSqlTag (token, SQLTAG_VARIABLE);
1586+
makeSqlTag (token, local? SQLTAG_LOCAL_VARIABLE: SQLTAG_VARIABLE);
15971587
}
15981588
findToken (token, TOKEN_SEMICOLON);
15991589
readToken (token);

0 commit comments

Comments
 (0)