You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2020/09/23 14:52:41 UTC

[GitHub] [lucenenet] theolivenbaum edited a comment on issue #350: Change ScoreDoc to struct?

theolivenbaum edited a comment on issue #350:
URL: https://github.com/apache/lucenenet/issues/350#issuecomment-697484139


   Guess that's exactly the cost of doing so - but i've the impression there are already a lot of places on the Lucene source code that rely on the similar pattern, instead of using generics + interfaces to enforce this at compile time:
   
   ```csharp
   if(!(obj is Class)) throw new Exception("Expected type X");
   ```
   
   This could be one case where the switch is worth, as currently Lucene allocates one ScoreDoc object for every search hit that needs to be scored, per search... But obviously better to test first :)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org