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

Use concrete ConcurrentHashSet instead of abstraction for performance #960

Merged
merged 2 commits into from
Sep 20, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/Lucene.Net/Search/ReferenceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected G Current

private readonly ReentrantLock refreshLock = new ReentrantLock();

private readonly ISet<ReferenceManager.IRefreshListener> refreshListeners = new ConcurrentHashSet<ReferenceManager.IRefreshListener>();
private readonly ConcurrentHashSet<ReferenceManager.IRefreshListener> refreshListeners = new ConcurrentHashSet<ReferenceManager.IRefreshListener>();

private void EnsureOpen()
{
Expand Down Expand Up @@ -367,7 +367,7 @@ public virtual void RemoveListener(ReferenceManager.IRefreshListener listener)
{
throw new ArgumentNullException(nameof(listener), "Listener cannot be null"); // LUCENENET specific - changed from IllegalArgumentException to ArgumentNullException (.NET convention)
}
refreshListeners.Remove(listener);
refreshListeners.TryRemove(listener);
}
}

Expand Down Expand Up @@ -396,4 +396,4 @@ public interface IRefreshListener
void AfterRefresh(bool didRefresh);
}
}
}
}
Loading