Skip to content

Commit 72f1a0d

Browse files
committed
Ruby: Clean up the CodeQL a little more.
1 parent 96e88a1 commit 72f1a0d

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,21 @@ module Impl implements InlineExpectationsTestSig {
1313
*/
1414
class ExpectationComment extends TAnyComment {
1515
string toString() {
16-
exists(Ruby::Comment c |
17-
this = RubyComment(c) and
18-
result = c.toString()
19-
)
16+
result = any(Ruby::Comment c | this = RubyComment(c)).toString()
2017
or
21-
exists(R::ErbComment c |
22-
this = ErbComment(c) and
23-
result = c.toString()
24-
)
18+
result = any(R::ErbComment c | this = ErbComment(c)).toString()
2519
}
2620

2721
Location getLocation() {
28-
exists(Ruby::Comment c |
29-
this = RubyComment(c) and
30-
result = c.getLocation()
31-
)
22+
result = any(Ruby::Comment c | this = RubyComment(c)).getLocation()
3223
or
33-
exists(R::ErbComment c |
34-
this = ErbComment(c) and
35-
result = c.getLocation()
36-
)
24+
result = any(R::ErbComment c | this = ErbComment(c)).getLocation()
3725
}
3826

3927
string getContents() {
40-
exists(Ruby::Comment c |
41-
this = RubyComment(c) and
42-
result = c.getValue().suffix(1)
43-
)
28+
result = any(Ruby::Comment c | this = RubyComment(c)).getValue().suffix(1)
4429
or
45-
exists(R::ErbComment c |
46-
this = ErbComment(c) and
47-
result = c.getValue().suffix(1)
48-
)
30+
result = any(R::ErbComment c | this = ErbComment(c)).getValue().suffix(1)
4931
}
5032
}
5133

0 commit comments

Comments
 (0)