Skip to content

Commit a9755e3

Browse files
committed
main,refactor: don't use else if if-block does return always
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 15bf140 commit a9755e3

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

main/options.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,17 +1771,16 @@ static char* extractMapFromParameter (const langType language,
17711771
*tail = parameter + strlen (parameter);
17721772
return result;
17731773
}
1774-
else
1775-
{
1776-
tmp = *p;
1777-
*p = '\0';
1778-
result = eStrdup (parameter);
1779-
*p = tmp;
1780-
*tail = p;
1781-
return result;
1782-
}
1774+
1775+
tmp = *p;
1776+
*p = '\0';
1777+
result = eStrdup (parameter);
1778+
*p = tmp;
1779+
*tail = p;
1780+
return result;
17831781
}
1784-
else if (first == PATTERN_START) /* pattern map */
1782+
1783+
if (first == PATTERN_START) /* pattern map */
17851784
{
17861785
*mapType = LMAP_PATTERN;
17871786

@@ -1794,15 +1793,13 @@ static char* extractMapFromParameter (const langType language,
17941793
if (*p == '\0')
17951794
error (FATAL, "Unterminated file name pattern for %s language",
17961795
getLanguageName (language));
1797-
else
1798-
{
1799-
tmp = *p;
1800-
*p = '\0';
1801-
result = eStrdup (parameter);
1802-
*p = tmp;
1803-
*tail = p + 1;
1804-
return result;
1805-
}
1796+
1797+
tmp = *p;
1798+
*p = '\0';
1799+
result = eStrdup (parameter);
1800+
*p = tmp;
1801+
*tail = p + 1;
1802+
return result;
18061803
}
18071804

18081805
return NULL;

0 commit comments

Comments
 (0)