From 18b544845f39121e461e9c7aaa54a09bbb9984e2 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 cb09d63..db822dd 100644 --- a/src/DotRecast.Core/Collections/RcSortedQueue.cs +++ b/src/DotRecast.Core/Collections/RcSortedQueue.cs @@ -27,12 +27,12 @@ namespace DotRecast.Core.Collections { 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 @@ namespace DotRecast.Core.Collections { if (_dirty) { - _items.Sort(_comparer); // reverse + _items.Sort(_comparison); // reverse _dirty = false; } }