From c7b9f42ea373e5f9af214b0bf0f8835147f7d0bc Mon Sep 17 00:00:00 2001 From: rameel Date: Mon, 23 Nov 2026 22:40:19 +0500 Subject: [PATCH] parser: pass method lists to ResolveMethod without copying --- src/Ramstack.ExpressionParser/ExpressionBuilder.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs index c7fb7fc..ec6caf0 100644 --- a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs +++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs @@ -14,12 +14,11 @@ public partial class ExpressionBuilder(Binder binder) : ExprVisitor /// /// The overloads of the string.Concat method that the + operator with a string operand is bound to. /// - private static readonly MethodBase[] s_concatMethods = typeof(string) + private static readonly MethodInfo[] s_concatMethods = typeof(string) .GetMethods(BindingFlags.Public | BindingFlags.Static) .Where(m => m.Name == nameof(string.Concat) && (m.CallingConvention & CallingConventions.VarArgs) == 0) - .Cast() .ToArray(); /// @@ -239,7 +238,7 @@ Expression ProcessIndex() if (methods.Count == 0) Error.NonIndexingType(self.Type); - var method = (MethodInfo?)MethodResolver.ResolveMethod(methods.ToArray(), parameterTypes); + var method = (MethodInfo?)MethodResolver.ResolveMethod(methods, parameterTypes); if (method is null) Error.AmbiguousMatch(indexers);