mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
feat: Adding dequeue overload to ScrollSqueue
This commit is contained in:
parent
a5d3a7c19d
commit
caa4878a37
1 changed files with 18 additions and 0 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue