Skip to content

Implement IEnumerable/IEnumerator in AbstractAppendingInt64Buffer, #279#1396

Open
paulirwin wants to merge 2 commits into
apache:masterfrom
paulirwin:issue/279
Open

Implement IEnumerable/IEnumerator in AbstractAppendingInt64Buffer, #279#1396
paulirwin wants to merge 2 commits into
apache:masterfrom
paulirwin:issue/279

Conversation

@paulirwin

@paulirwin paulirwin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to AbstractAppendingInt64Buffer via 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 (EnumberableEnumerable) 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.

Comment thread src/Lucene.Net/Util/Packed/AbstractAppendingLongBuffer.cs
Comment thread src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
Comment thread src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
Comment thread src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
Comment thread src/Lucene.Net/Index/SortedDocValuesWriter.cs
Comment thread src/Lucene.Net/Index/NumericDocValuesWriter.cs Outdated
Comment thread src/Lucene.Net/Index/BinaryDocValuesWriter.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:breaking-change Has changes that will break backward compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert Java Iterator classes to implement IEnumerable<T>

3 participants