paulirwin commented on code in PR #938:
URL: https://github.com/apache/lucenenet/pull/938#discussion_r1597692468
##########
src/Lucene.Net/Support/ConcurrentHashSet.cs:
##########
@@ -753,7 +753,16 @@ private void CopyToItems(T[] array, int index)
public void ExceptWith(IEnumerable<T> other)
{
- throw new NotImplementedException();
+ if (ReferenceEquals(this, other))
+ {
+ Clear();
+ return;
+ }
+
+ foreach (var item in other)
+ {
+ TryRemove(item);
Review Comment:
Also this raises that we should probably add an optimization to
`FSDirectory.Sync` that doesn't try to do its logic if the stale files (or
`toSync` copy) hashset is empty... then we wouldn't even get to the
`ExceptWith` optimization in this case anyways.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]