PERFORMANCE: Lucene.Net.Replicator.LocalReplicator::CheckExpiredSessions(): Remove unnecessary dictionary allocation #1070
Labels
good-first-issue
Good for newcomers
is:task
A chore to be done
performance
pri:normal
up-for-grabs
This issue is open to be worked on by anyone
Milestone
Is there an existing issue for this?
Task description
In
Lucene.Net.Replicator.LocalReplicator::CheckExpiredSessions()
, there is an extra.ToArray()
call that allocates a new collection to iterate theValues
:lucenenet/src/Lucene.Net.Replicator/LocalReplicator.cs
Lines 135 to 146 in a739a80
J2N 2.1 includes the update to
J2N.Collections.Generic.Dictionary<TKey, TValue>
that allows deleting while iterating forward through the collection in older target frameworks. So, swapping the implementation of thesessions
field will allow us to remove this extra allocation.The text was updated successfully, but these errors were encountered: