Skip to content

Commit 22f18b2

Browse files
committed
Reorder some conditions for performance
1 parent 6af545b commit 22f18b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CppHeaderParser/CppHeaderParser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,12 +3280,12 @@ def _evaluate_stack(self, token=None):
32803280
not self.curClass
32813281
and "typedef" in self.nameStack
32823282
and (
3283-
(
3283+
self.stack[-1] == ";"
3284+
or (
32843285
"struct" not in self.nameStack
32853286
and "union" not in self.nameStack
32863287
and "enum" not in self.nameStack
32873288
)
3288-
or self.stack[-1] == ";"
32893289
)
32903290
):
32913291
debug_print("trace")
@@ -3350,7 +3350,7 @@ def _evaluate_stack(self, token=None):
33503350
# lookup is done
33513351
alias = self.current_namespace() + alias
33523352
self.using[alias] = atype
3353-
elif is_method_namestack(self.stack) and "(" in self.nameStack:
3353+
elif "(" in self.nameStack and is_method_namestack(self.stack):
33543354
debug_print("trace")
33553355
self._evaluate_method_stack()
33563356
elif is_enum_namestack(self.nameStack):
@@ -3377,7 +3377,7 @@ def _evaluate_stack(self, token=None):
33773377
self.classes[new_name] = type_to_rename
33783378
if new_name != type_name_to_rename:
33793379
del self.classes[type_name_to_rename]
3380-
elif is_property_namestack(self.nameStack) and self.stack[-1] == ";":
3380+
elif self.stack[-1] == ";" and is_property_namestack(self.nameStack):
33813381
debug_print("trace")
33823382
if self.nameStack[0] in ("class", "struct") and len(self.stack) == 3:
33833383
self.evalute_forward_decl()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy