AlexanderSaydakov commented on code in PR #475:
URL: https://github.com/apache/datasketches-java/pull/475#discussion_r1409983120
##########
src/main/java/org/apache/datasketches/kll/KllItemsSketchSortedView.java:
##########
@@ -132,18 +204,36 @@ public double[] getPMF(final T[] splitPoints, final
QuantileSearchCriteria searc
public T getQuantile(final double rank, final QuantileSearchCriteria
searchCrit) {
if (isEmpty()) { throw new SketchesArgumentException(EMPTY_MSG); }
QuantilesUtil.checkNormalizedRankBounds(rank);
+ final int index = getQuantileIndex(rank, searchCrit);
+ return getQuantileFromIndex(index);
+ }
+
+ private T getQuantileFromIndex(final int index) { return quantiles[index]; }
Review Comment:
Perhaps I did not make myself clear. My point was that having a method that
just returns arr[index] seems to be unnecessary. why not just put arr[index]
where it is called? This is a private method, so it does not seem to be an
abstraction that hides some details from the user.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]