Implement IEnumerable/IEnumerator in AbstractAppendingInt64Buffer, #279#1396
Open
paulirwin wants to merge 2 commits into
Open
Implement IEnumerable/IEnumerator in AbstractAppendingInt64Buffer, #279#1396paulirwin wants to merge 2 commits into
paulirwin wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements .NET enumeration support for AbstractAppendingInt64Buffer (so it can be used with foreach/LINQ) and updates internal call sites/tests that previously used the custom GetIterator() pattern.
Changes:
- Added
IEnumerable<long>/IEnumerator<long>support toAbstractAppendingInt64Buffervia a new enumerator implementation. - Updated DocValues writers to use the new enumerator instead of the removed iterator pattern.
- Updated tests and corrected private method naming typos (
Enumberable→Enumerable) where touched.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Lucene.Net/Util/Packed/AbstractAppendingLongBuffer.cs | Adds IEnumerable<long> support and replaces the custom iterator with an IEnumerator<long>-based enumerator. |
| src/Lucene.Net/Index/SortedSetDocValuesWriter.cs | Switches pending buffer iteration to use GetEnumerator() in iterator blocks. |
| src/Lucene.Net/Index/SortedDocValuesWriter.cs | Renames private enumerable helpers and switches ord iteration to GetEnumerator(). |
| src/Lucene.Net/Index/NumericDocValuesWriter.cs | Switches numeric pending buffer iteration to GetEnumerator() in an iterator block. |
| src/Lucene.Net/Index/BinaryDocValuesWriter.cs | Switches lengths buffer iteration to GetEnumerator() in an iterator block. |
| src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs | Updates tests to validate enumeration via MoveNext()/Current. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement IEnumerable/IEnumerator in AbstractAppendingInt64Buffer
Fixes #279 (as the final remaining item)
Description
This implements IEnumerable properly in AbstractAppendingInt64Buffer, and updates the usages of the prior GetIterator method to use the enumerator.