proost commented on code in PR #800:
URL: https://github.com/apache/datasketches-java/pull/800#discussion_r4577190993
##########
src/main/java/org/apache/datasketches/kll/KllHeapItemsSketch.java:
##########
@@ -119,12 +119,12 @@ final class KllHeapItemsSketch<T> extends
KllItemsSketch<T> {
n = segVal.n;
minK = segVal.minK;
isLevelZeroSorted = segVal.level0SortedFlag;
- itemsArr = new Object[levelsArr[segVal.numLevels]]; //updatable size
final SketchStructure segStruct = segVal.sketchStructure;
+ //an empty image allocates no item storage; it is allocated on first use
+ itemsArr = (segStruct == COMPACT_EMPTY) ? null : new
Object[levelsArr[segVal.numLevels]]; //updatable size
Review Comment:
updatable format can allocate earlier. Do you intend?
--
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]