Skip to content

Commit

Permalink
Simplify IndexReader constructor, #919 (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin authored Jan 1, 2025
1 parent d96dc9e commit 47adc07
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Lucene.Net/Index/IndexReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ public abstract partial class IndexReader : IDisposable

private protected IndexReader() // LUCENENET: Changed from internal to private protected
{
if (!(this is CompositeReader || this is AtomicReader))
{
throw Error.Create("IndexReader should never be directly extended, subclass AtomicReader or CompositeReader instead.");
}
// LUCENENET NOTE: this is enforced by the compiler in .NET due to `private protected`, so we don't need to check it here.
// if (!(this is CompositeReader || this is AtomicReader))
// {
// throw Error.Create("IndexReader should never be directly extended, subclass AtomicReader or CompositeReader instead.");
// }
}

#if !FEATURE_CONDITIONALWEAKTABLE_ENUMERATOR
Expand Down

0 comments on commit 47adc07

Please sign in to comment.