@@ -27,10 +27,10 @@ predicate isIEnumerableType(ValueOrRefType t) {
2727}
2828
2929/**
30- * Holds if `ForeachStmt` could be converted to a `.All()` call. That is,
31- * the `ForeachStmt` contains a single `if` with a condition that accesses
32- * the loop variable and with a body that assigns `false` to a variable and
33- * `break`s out of the `foreach`.
30+ * Holds if `foreach` statement `fes` could be converted to a `.All()` call.
31+ * That is, the `ForeachStmt` contains a single `if` with a condition that
32+ * accesses the loop variable and with a body that assigns `false` to a variable
33+ * and `break`s out of the `foreach`.
3434 */
3535predicate missedAllOpportunity ( ForeachStmt fes ) {
3636 exists ( IfStmt is |
@@ -51,9 +51,10 @@ predicate missedAllOpportunity(ForeachStmt fes) {
5151}
5252
5353/**
54- * Holds if `ForeachStmt` could be converted to a `.Cast()` call. That is, the
55- * loop variable is accessed only in the first statement of the block, and the
56- * access is a cast. The first statement needs to be a `LocalVariableDeclStmt`.
54+ * Holds if `foreach` statement `fes` could be converted to a `.Cast()` call.
55+ * That is, the loop variable is accessed only in the first statement of the
56+ * block, and the access is a cast. The first statement needs to be a
57+ * `LocalVariableDeclStmt`.
5758 */
5859predicate missedCastOpportunity ( ForeachStmt fes , LocalVariableDeclStmt s ) {
5960 s = firstStmt ( fes ) and
@@ -67,10 +68,10 @@ predicate missedCastOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
6768}
6869
6970/**
70- * Holds if `ForeachStmt` could be converted to an `.OfType()` call. That is, the
71- * loop variable is accessed only in the first statement of the block, and the
72- * access is a cast with the `as` operator. The first statement needs to be a
73- * `LocalVariableDeclStmt`.
71+ * Holds if `foreach` statement `fes` could be converted to an `.OfType()` call.
72+ * That is, the loop variable is accessed only in the first statement of the
73+ * block, and the access is a cast with the `as` operator. The first statement
74+ * needs to be a `LocalVariableDeclStmt`.
7475 */
7576predicate missedOfTypeOpportunity ( ForeachStmt fes , LocalVariableDeclStmt s ) {
7677 s = firstStmt ( fes ) and
@@ -84,9 +85,10 @@ predicate missedOfTypeOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
8485}
8586
8687/**
87- * Holds if `ForeachStmt` could be converted to a `.Select()` call. That is, the
88- * loop variable is accessed only in the first statement of the block, and the
89- * access is not a cast. The first statement needs to be a `LocalVariableDeclStmt`.
88+ * Holds if `foreach` statement `fes` could be converted to a `.Select()` call.
89+ * That is, the loop variable is accessed only in the first statement of the
90+ * block, and the access is not a cast. The first statement needs to be a
91+ * `LocalVariableDeclStmt`.
9092 */
9193predicate missedSelectOpportunity ( ForeachStmt fes , LocalVariableDeclStmt s ) {
9294 s = firstStmt ( fes ) and
@@ -97,10 +99,10 @@ predicate missedSelectOpportunity(ForeachStmt fes, LocalVariableDeclStmt s) {
9799}
98100
99101/**
100- * Holds if `ForeachStmt` could be converted to a `.Where()` call. That is, first
101- * statement of the loop is an `if`, which accesses the loop variable, and the body
102- * of the `if` is either a `continue` or there's nothing else in the loop than the
103- * `if`.
102+ * Holds if `foreach` statement `fes` could be converted to a `.Where()` call.
103+ * That is, first statement of the loop is an `if`, which accesses the loop
104+ * variable, and the body of the `if` is either a `continue` or there's nothing
105+ * else in the loop than the `if`.
104106 */
105107predicate missedWhereOpportunity ( ForeachStmt fes , IfStmt is ) {
106108 // The very first thing the foreach loop does is test its iteration variable.
0 commit comments