-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbae6a8
commit 94b3256
Showing
7 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
**API count: 401** | ||
**API count: 402** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// <auto-generated /> | ||
#pragma warning disable | ||
|
||
#if NETFRAMEWORK || NETSTANDARD2_0 | ||
|
||
namespace Polyfills; | ||
|
||
using System; | ||
using System.Collections.Concurrent; | ||
using Link = System.ComponentModel.DescriptionAttribute; | ||
|
||
static partial class Polyfill | ||
{ | ||
/// <summary> | ||
/// Removes all values from the <see cref="ConcurrentQueue{T}"/>. | ||
/// </summary> | ||
[Link("https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentqueue-1.clear")] | ||
public static void Clear<T>(this ConcurrentQueue<T> target) | ||
{ | ||
while (target.TryDequeue(out _)); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
partial class PolyfillTests | ||
{ | ||
[Test] | ||
public void ConcurrentQueueClear() | ||
{ | ||
var bag = new ConcurrentQueue<string>(); | ||
bag.Enqueue("Hello"); | ||
bag.Clear(); | ||
Assert.AreEqual(0, bag.Count); | ||
} | ||
} |