Skip to content

Commit

Permalink
Use 'ToList()' instead of 'new List(..)'
Browse files Browse the repository at this point in the history
  • Loading branch information
WanjohiSammy committed Nov 13, 2024
1 parent df8bfe6 commit 4d38f5f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Microsoft.OData.Core/UriParser/Binders/FunctionCallBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,16 @@ internal QueryNode BindFunctionCall(FunctionCallToken functionCallToken)

// If there isn't, bind as Uri function
// Bind all arguments
List<QueryNode> argumentNodes = new List<QueryNode>(functionCallToken.Arguments.Select(argument =>
List<QueryNode> argumentNodes = functionCallToken.Arguments.Select(argument =>
{
QueryNode argumentNode;
// If the function is IsOf or Cast and the argument is a dotted identifier, we need to bind it differently
if (UnboundFunctionNames.Contains(functionCallToken.Name) && argument.ValueToken is DottedIdentifierToken dottedIdentifier)
{
argumentNode = this.TryBindDottedIdentifierForIsOfOrCastFunctionCall(dottedIdentifier);
}
else
{
argumentNode = this.bindMethod(argument);
return this.TryBindDottedIdentifierForIsOfOrCastFunctionCall(dottedIdentifier);
}

return argumentNode;
}));
return this.bindMethod(argument);
}).ToList();

return BindAsUriFunction(functionCallToken, argumentNodes);
}
Expand Down

0 comments on commit 4d38f5f

Please sign in to comment.