Skip to content

Commit

Permalink
Methods optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Feb 9, 2025
1 parent a303bf4 commit 9b06d57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions YantraJS.Core/LinqExpressions/KeyStringsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using YantraJS.Core;
using YantraJS.Core.Core.Storage;
using YantraJS.Core.LambdaGen;
using YantraJS.Expressions;
using Exp = YantraJS.Expressions.YExpression;
using Expression = YantraJS.Expressions.YExpression;
Expand All @@ -13,14 +14,14 @@ namespace YantraJS.ExpHelper
{
internal class KeyStringsBuilder
{
private static MethodInfo _GetOrAdd =
typeof(KeyStrings).PublicMethod(nameof(KeyStrings.GetOrCreate), StringSpanBuilder.RefType);

public static readonly Type RefType = typeof(KeyString).MakeByRefType();

public static Expression GetOrCreate(Expression text)
{
return Expression.Call(null, _GetOrAdd, text);
return NewLambdaExpression.StaticCallExpression<KeyString>(() =>
() => KeyStrings.GetOrCreate((StringSpan)"")
, text);
// return Expression.Call(null, _GetOrAdd, text);
}

public readonly static StringMap<YFieldExpression> Fields =
Expand Down

0 comments on commit 9b06d57

Please sign in to comment.