Skip to content

Commit

Permalink
Simplify if clause.
Browse files Browse the repository at this point in the history
  • Loading branch information
afoucret committed Jul 18, 2024
1 parent fa55072 commit d8b869e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,10 @@ public void _setTermStats(TermStatsReader termStatsReader) {
* Accessed as _termStatistics in the painless script.
*/
public TermStatsReader get_termStatistics() {
if (termStatsReader != null) {
return termStatsReader;
if (termStatsReader == null) {
throw new IllegalArgumentException("_termStatistics is not available");
}

throw new IllegalArgumentException("_termStatistics is not available");
return termStatsReader;
}

/** A factory to construct {@link ScoreScript} instances. */
Expand Down

0 comments on commit d8b869e

Please sign in to comment.