mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
feat: Adding dequeue overload to ScrollSqueue
This commit is contained in:
@@ -101,6 +101,24 @@ namespace ICD.Common.Utils.Collections
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Dequeues the next item in the queue. Returns false if the queue is empty.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TContents"></typeparam>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[PublicAPI]
|
||||||
|
public bool Dequeue(out TContents item)
|
||||||
|
{
|
||||||
|
item = default(TContents);
|
||||||
|
|
||||||
|
if (Count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
item = Dequeue();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the oldest item in the queue.
|
/// Returns the oldest item in the queue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user