From 72f1a0d89b476957fecfa78b98268f3a8347cf6e Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 29 Jun 2026 11:11:45 +0100 Subject: [PATCH] Ruby: Clean up the CodeQL a little more. --- .../internal/InlineExpectationsTestImpl.qll | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll b/ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll index bf0da4cd9e5..01c73f26a39 100644 --- a/ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll +++ b/ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll @@ -13,39 +13,21 @@ module Impl implements InlineExpectationsTestSig { */ class ExpectationComment extends TAnyComment { string toString() { - exists(Ruby::Comment c | - this = RubyComment(c) and - result = c.toString() - ) + result = any(Ruby::Comment c | this = RubyComment(c)).toString() or - exists(R::ErbComment c | - this = ErbComment(c) and - result = c.toString() - ) + result = any(R::ErbComment c | this = ErbComment(c)).toString() } Location getLocation() { - exists(Ruby::Comment c | - this = RubyComment(c) and - result = c.getLocation() - ) + result = any(Ruby::Comment c | this = RubyComment(c)).getLocation() or - exists(R::ErbComment c | - this = ErbComment(c) and - result = c.getLocation() - ) + result = any(R::ErbComment c | this = ErbComment(c)).getLocation() } string getContents() { - exists(Ruby::Comment c | - this = RubyComment(c) and - result = c.getValue().suffix(1) - ) + result = any(Ruby::Comment c | this = RubyComment(c)).getValue().suffix(1) or - exists(R::ErbComment c | - this = ErbComment(c) and - result = c.getValue().suffix(1) - ) + result = any(R::ErbComment c | this = ErbComment(c)).getValue().suffix(1) } }