Skip to content

Commit 7dfa58b

Browse files
committed
Remove Content::NoContent
1 parent 9c93ad9 commit 7dfa58b

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ private module Cached {
390390
class TContentSet = TSingletonContent or TAnyElementContent or TElementLowerBoundContent;
391391

392392
cached
393-
newtype TOptionalContent =
394-
TNoContent() or
393+
newtype TContent =
395394
TKnownElementContent(ConstantValue cv) {
396395
not cv.isInt(_) or
397396
cv.getInt() in [0 .. 10]
@@ -418,11 +417,6 @@ private module Cached {
418417
// Only used by type-tracking
419418
TAttributeName(string name) { name = any(AST::SetterMethodCall c).getTargetName() }
420419

421-
cached
422-
class TContent =
423-
TKnownElementContent or TUnknownElementContent or TKnownPairValueContent or
424-
TUnknownPairValueContent or TFieldContent or TAttributeName;
425-
426420
/**
427421
* Holds if `e` is an `ExprNode` that may be returned by a call to `c`.
428422
*/

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPublic.qll

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,15 @@ predicate localExprFlow(CfgNodes::ExprCfgNode e1, CfgNodes::ExprCfgNode e2) {
235235
localFlow(exprNode(e1), exprNode(e2))
236236
}
237237

238-
/** A reference contained in an object, or the `noContent()` value. */
239-
class OptionalContent extends TOptionalContent {
238+
/** A reference contained in an object. */
239+
class Content extends TContent {
240240
/** Gets a textual representation of this content. */
241241
string toString() { none() }
242242

243243
/** Gets the location of this content. */
244244
Location getLocation() { none() }
245245
}
246246

247-
/** A reference contained in an object. */
248-
class Content extends OptionalContent, TContent { }
249-
250247
/** Provides different sub classes of `Content`. */
251248
module Content {
252249
/** An element in a collection, for example an element in an array or in a hash. */
@@ -337,14 +334,6 @@ module Content {
337334

338335
/** Gets `AttributeNameContent` of the given name. */
339336
AttributeNameContent getAttributeName(string name) { result.getName() = name }
340-
341-
/** A value representing no content. */
342-
class NoContent extends OptionalContent, TNoContent {
343-
override string toString() { result = "noContent()" }
344-
}
345-
346-
/** Gets the `noContent()` value. */
347-
NoContent noContent() { any() }
348337
}
349338

350339
class OptionalContentSet extends TOptionalContentSet {

0 commit comments

Comments
 (0)