Skip to content

Commit 4392e30

Browse files
committed
CPreProcessor: reduce the number of calling pushLanguage()/popLanguage()
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 899c9f4 commit 4392e30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

parsers/cpreprocessor.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,14 +842,14 @@ static void makeIncludeTag (const char *const name, bool systemHeader)
842842
static void makeParamTag (vString *name, short nth, bool placeholder)
843843
{
844844
bool standing_alone = doesCPreProRunAsStandaloneParser(CPREPRO_MACRO);
845-
langType lang = standing_alone ? Cpp.lang: Cpp.clientLang;
846845

847846
Assert (Cpp.macroParamKindIndex != KIND_GHOST_INDEX);
848847

849-
int r;
850-
pushLanguage (lang);
851-
r = makeSimpleTag (name, Cpp.macroParamKindIndex);
852-
popLanguage ();
848+
if (standing_alone)
849+
pushLanguage (Cpp.lang);
850+
int r = makeSimpleTag (name, Cpp.macroParamKindIndex);
851+
if (standing_alone)
852+
popLanguage ();
853853

854854
tagEntryInfo *e = getEntryInCorkQueue (r);
855855
if (e)

0 commit comments

Comments
 (0)