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

Simplify IndexReader constructor, #919 #1081

Merged
merged 1 commit into from
Jan 1, 2025
Merged

Conversation

paulirwin
Copy link
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.

Simplify IndexReader constructor.

Fixes #919

Description

This removes the type check in the IndexReader constructor that ensures that only CompositeReader and AtomicReader are allowed subtypes. This is not needed since in C# we can use the private protected modifier to ensure that no outside classes can subtype this. This removes the need for the runtime check in the constructor, which will mildly improve performance. A comment was left explaining the divergence with the original commented-out code.

@paulirwin paulirwin added the notes:performance-improvement Contains a performance improvement label Jan 1, 2025
@paulirwin paulirwin merged commit 47adc07 into apache:master Jan 1, 2025
267 checks passed
@paulirwin paulirwin deleted the issue/919 branch January 1, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes:performance-improvement Contains a performance improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify IndexReader constructor
1 participant