aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-09-20 13:22:39 -0400
committerGitHub <noreply@github.com>2017-09-20 13:22:39 -0400
commiteb2a1330045d802bfe0366df7105c220a36f111f (patch)
tree2c1638c424ee9c0837c5de6d6e08a2398da69cdb /MediaBrowser.Providers/Manager/GenericPriorityQueue.cs
parentec426d5c92875639ceac64477ce10fab3e639335 (diff)
parenta015e1208885bc6a8788db683c4fe47e93dc26b7 (diff)
Merge pull request #2897 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Providers/Manager/GenericPriorityQueue.cs')
-rw-r--r--MediaBrowser.Providers/Manager/GenericPriorityQueue.cs15
1 files changed, 1 insertions, 14 deletions
diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs
index e24547614..0e6c07357 100644
--- a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs
+++ b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@@ -66,9 +67,7 @@ namespace Priority_Queue
/// Removes every node from the queue.
/// O(n) (So, don't do this often!)
/// </summary>
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
public void Clear()
{
Array.Clear(_nodes, 1, _numNodes);
@@ -78,9 +77,7 @@ namespace Priority_Queue
/// <summary>
/// Returns (in O(1)!) whether the given node is in the queue. O(1)
/// </summary>
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
public bool Contains(TItem node)
{
#if DEBUG
@@ -103,9 +100,7 @@ namespace Priority_Queue
/// If the node is already enqueued, the result is undefined.
/// O(log n)
/// </summary>
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
public void Enqueue(TItem node, TPriority priority)
{
#if DEBUG
@@ -131,9 +126,7 @@ namespace Priority_Queue
CascadeUp(_nodes[_numNodes]);
}
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
private void Swap(TItem node1, TItem node2)
{
//Swap the nodes
@@ -164,9 +157,7 @@ namespace Priority_Queue
}
}
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
private void CascadeDown(TItem node)
{
//aka Heapify-down
@@ -228,9 +219,7 @@ namespace Priority_Queue
/// Returns true if 'higher' has higher priority than 'lower', false otherwise.
/// Note that calling HasHigherPriority(node, node) (ie. both arguments the same node) will return false
/// </summary>
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
private bool HasHigherPriority(TItem higher, TItem lower)
{
var cmp = higher.Priority.CompareTo(lower.Priority);
@@ -319,9 +308,7 @@ namespace Priority_Queue
/// Calling this method on a node not in the queue results in undefined behavior
/// O(log n)
/// </summary>
-#if NET_VERSION_4_5
[MethodImpl(MethodImplOptions.AggressiveInlining)]
-#endif
public void UpdatePriority(TItem node, TPriority priority)
{
#if DEBUG