TKey can not be null.

This commit is contained in:
glax 2023-05-17 19:01:00 +02:00
parent dc98fb51b1
commit e53d1086cc

View File

@ -16,9 +16,9 @@ public class RPriorityQueue<TKey, TPriority> where TKey : notnull
queue[key] = priority;
}
public TKey? Dequeue()
public TKey Dequeue()
{
TKey? retKey = queue.MinBy(item => item.Value).Key;
TKey retKey = queue.MinBy(item => item.Value).Key;
queue.Remove(retKey);
return retKey;
}