Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU4N.Support.AnonymousComparer: Deleted because this is the same functionality as Comparer<T>.Compare() #83

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/ICU4N/Support/AnonymousComparer.cs

This file was deleted.

4 changes: 2 additions & 2 deletions tests/ICU4N.Tests/Dev/Test/Util/ICUServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public void TestAPI()
// list the display names in reverse order
{
Logln("display names in reverse order: " +
service.GetDisplayNames(new UCultureInfo("en_US"), new AnonymousComparer<object>(compare: (lhs, rhs) =>
service.GetDisplayNames(new UCultureInfo("en_US"), Comparer<object>.Create(comparison: (lhs, rhs) =>
{
return -StringComparer.OrdinalIgnoreCase.Compare((string)lhs, (string)rhs);
})));
Expand Down Expand Up @@ -888,7 +888,7 @@ public void TestLocale()
// hmmm, the default toString function doesn't print in sorted order for TreeMap
{
var map = service.GetDisplayNames(new UCultureInfo("en_US"),
new AnonymousComparer<object>(compare: (lhs, rhs) =>
Comparer<object>.Create(comparison: (lhs, rhs) =>
{
return -StringComparer.OrdinalIgnoreCase.Compare((string)lhs, (string)rhs);
}),
Expand Down
2 changes: 1 addition & 1 deletion tests/ICU4N.Tests/Dev/Test/Util/ICUServiceThreadTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public void Test04_WitheringService()
RegisterFactories(service, fc);

IServiceFactory[] factories = (IServiceFactory[])fc.ToArray();
var comp = new AnonymousComparer<object>(compare: (lhs, rhs) =>
var comp = Comparer<object>.Create(comparison: (lhs, rhs) =>
{
return lhs.ToString().CompareToOrdinal(rhs.ToString());
});
Expand Down