High-Speed-Priority-Queue-for-C-Sharp icon indicating copy to clipboard operation
High-Speed-Priority-Queue-for-C-Sharp copied to clipboard

Add SimplePriorityQueue.Try...() overloads that expose priority as out parameter

Open JohannesMP opened this issue 4 years ago • 0 comments

  • Add SimplePriorityQueue.TryDequeue() overload with out TPriority parameter and relevant unit tests
  • Add SimplePriorityQueue.TryRemove() overload with out TPriority parameter and relevant unit tests
  • Add SimplePriorityQueue.TryFirst() overload with out TPriority parameter and relevant unit tests

In each case if the caller wants the priority of the head/head-to-be-removed/node-to-be-removed, they can now get it without an additional (Try)GetPriority call, making it easier to remain thread-safe while also avoiding an extra _itemToNodesCache lookup.

See issue https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp/issues/54

JohannesMP avatar Jul 26 '21 02:07 JohannesMP