From 5c4c774d891def0227796e79576e579760159910 Mon Sep 17 00:00:00 2001 From: wrenge Date: Wed, 13 Nov 2024 09:35:27 +0300 Subject: [PATCH] Pass delegate --- src/DotRecast.Core/Collections/RcSortedQueue.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DotRecast.Core/Collections/RcSortedQueue.cs b/src/DotRecast.Core/Collections/RcSortedQueue.cs index cb09d63a..db822dd8 100644 --- a/src/DotRecast.Core/Collections/RcSortedQueue.cs +++ b/src/DotRecast.Core/Collections/RcSortedQueue.cs @@ -27,12 +27,12 @@ public class RcSortedQueue { private bool _dirty; private readonly List _items; - private readonly Comparer _comparer; + private readonly Comparison _comparison; public RcSortedQueue(Comparison comp) { _items = new List(); - _comparer = Comparer.Create((x, y) => comp.Invoke(x, y) * -1); + _comparison = (x, y) => comp(x, y) * -1; } public int Count() @@ -55,7 +55,7 @@ private void Balance() { if (_dirty) { - _items.Sort(_comparer); // reverse + _items.Sort(_comparison); // reverse _dirty = false; } }