perf(advanced-search): span-based leaf evaluator for EvaluateBoolean
Custom LeafEvaluator<TState> delegate takes the leaf as ReadOnlySpan<char> (Func<> can't take a ref struct) and threads caller state through, so the property-test recursion allocates neither a per-leaf string nor a capturing closure per entity.
This commit is contained in:
parent
b22a35e4ad
commit
3516aa6d85
3 changed files with 12 additions and 6 deletions
|
|
@ -349,7 +349,7 @@ public class AdvancedSearchThreadWorker
|
|||
}
|
||||
|
||||
private static bool EvaluateRecursive(IEntity entity, ReadOnlySpan<char> span) =>
|
||||
AdvancedSearchUtilities.EvaluateBoolean(span, leaf => EvaluateSingleExpression(entity, leaf));
|
||||
AdvancedSearchUtilities.EvaluateBoolean(span, entity, static (e, leaf) => EvaluateSingleExpression(e, leaf));
|
||||
|
||||
private static bool EvaluateSingleExpression(IEntity entity, ReadOnlySpan<char> expression)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue