Skip to content

Commit ed5f2c5

Browse files
Update Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs
This will likely not happen since the if(endIndex==null) handles and returns desired list. But this looks more like a sanity fix to make sure that under any manipulation inside else block if endIndex is then set to null, it does not always default to 0 and returns Take(0-startIndex) => Take(-startIndex) and give an empty list, which is not the intent of this block. Hence, accepting this fix. Co-authored-by: Copilot <[email protected]>
1 parent 87df5a6 commit ed5f2c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ internal partial class CqlOperators
10631063
}
10641064
else
10651065
{
1066-
return source.Skip(startIndex ?? 0).Take((endIndex ?? 0) - (startIndex ?? 0)).ToList();
1066+
return source.Skip(startIndex ?? 0).Take(endIndex.Value - (startIndex ?? 0)).ToList();
10671067
}
10681068
}
10691069

0 commit comments

Comments
 (0)