-
Notifications
You must be signed in to change notification settings - Fork 76
Fix performance RULE-6-4-2 RULE-7-0-4
#1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
48e7aa8
06080b0
48a06df
e489771
e7b9b67
e2b7fe2
6b3a97d
857827d
ae5535a
ca475bc
7fca1ce
a2c0746
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| - `RULE-6-4-2` - `InheritedOverridableMemberFunction.ql`: | ||
| - Improved evaluation performance. | ||
|
mbaluda marked this conversation as resolved.
|
||
| - `RULE-7-0-4` - `InappropriateBitwiseOrShiftOperands.ql`: | ||
| - Improved evaluation performance. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,15 +12,24 @@ abstract class HiddenInheritedOverridableMemberFunctionSharedQuery extends Query | |||||||||||||||||
|
|
||||||||||||||||||
| Query getQuery() { result instanceof HiddenInheritedOverridableMemberFunctionSharedQuery } | ||||||||||||||||||
|
|
||||||||||||||||||
| class OverridingDeclaration extends FunctionDeclarationEntry { | ||||||||||||||||||
| OverridingDeclaration() { this.getDeclaration().hasDefinition() implies not this.isDefinition() } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| class HiddenDeclaration extends OverridingDeclaration { | ||||||||||||||||||
| HiddenDeclaration() { | ||||||||||||||||||
| // Check if we are overriding a virtual inherited member function | ||||||||||||||||||
| this.getDeclaration().isVirtual() and | ||||||||||||||||||
| // Exclude private member functions, which cannot be inherited. | ||||||||||||||||||
|
mbaluda marked this conversation as resolved.
|
||||||||||||||||||
| not this.getDeclaration().(MemberFunction).isPrivate() | ||||||||||||||||||
| } | ||||||||||||||||||
|
mbaluda marked this conversation as resolved.
Outdated
|
||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| query predicate problems( | ||||||||||||||||||
| FunctionDeclarationEntry overridingDecl, string message, FunctionDeclarationEntry hiddenDecl, | ||||||||||||||||||
| OverridingDeclaration overridingDecl, string message, HiddenDeclaration hiddenDecl, | ||||||||||||||||||
| string hiddenDecl_string | ||||||||||||||||||
| ) { | ||||||||||||||||||
|
Comment on lines
+29
to
31
|
||||||||||||||||||
| OverridingDeclaration overridingDecl, string message, HiddenDeclaration hiddenDecl, | |
| string hiddenDecl_string | |
| ) { | |
| FunctionDeclarationEntry overridingDecl, string message, | |
| FunctionDeclarationEntry hiddenDecl, string hiddenDecl_string | |
| ) { | |
| overridingDecl instanceof OverridingDeclaration and | |
| hiddenDecl instanceof HiddenDeclaration and |
Uh oh!
There was an error while loading. Please reload this page.