mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #5031 from MathiasVP/remove-linear-scan-of-functions-2
C++: Remove more linear scans
This commit is contained in:
@@ -50,5 +50,5 @@ class CStyleComment extends Comment {
|
||||
* ```
|
||||
*/
|
||||
class CppStyleComment extends Comment {
|
||||
CppStyleComment() { this.getContents().prefix(2) = "//" }
|
||||
CppStyleComment() { this.getContents().matches("//%") }
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ abstract class MutexType extends Type {
|
||||
private Function mustlockCandidate() {
|
||||
exists(string name | name = result.getName() |
|
||||
name = "lock" or
|
||||
name.suffix(name.length() - 10) = "mutex_lock"
|
||||
name.matches("%mutex\\_lock")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ private Function mustlockCandidate() {
|
||||
private Function trylockCandidate() {
|
||||
exists(string name | name = result.getName() |
|
||||
name = "try_lock" or
|
||||
name.suffix(name.length() - 13) = "mutex_trylock"
|
||||
name.matches("%mutex\\_trylock")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ private Function trylockCandidate() {
|
||||
private Function unlockCandidate() {
|
||||
exists(string name | name = result.getName() |
|
||||
name = "unlock" or
|
||||
name.suffix(name.length() - 12) = "mutex_unlock"
|
||||
name.matches("%mutex\\_unlock")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user