Skip to content

Commit 339b82e

Browse files
committed
Remove code duplicate from other PR
1 parent ffd6992 commit 339b82e

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogram.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -202,53 +202,6 @@ static int hashCode(ExponentialHistogram histogram) {
202202
return hash;
203203
}
204204

205-
/**
206-
* Default toString implementation for exponential histograms.
207-
* @param histogram the histogram to convert to string
208-
* @return a string representation of the histogram
209-
*/
210-
static String toString(ExponentialHistogram histogram) {
211-
StringBuilder sb = new StringBuilder("ExponentialHistogram{");
212-
sb.append("scale=").append(histogram.scale());
213-
sb.append(", sum=").append(histogram.sum());
214-
sb.append(", valueCount=").append(histogram.valueCount());
215-
sb.append(", min=").append(histogram.min());
216-
ZeroBucket zb = histogram.zeroBucket();
217-
if (zb.zeroThreshold() != 0) {
218-
sb.append(", zeroThreshold=").append(zb.zeroThreshold());
219-
}
220-
if (zb.count() != 0) {
221-
sb.append(", zeroCount=").append(zb.count());
222-
}
223-
BucketIterator neg = histogram.negativeBuckets().iterator();
224-
if (neg.hasNext()) {
225-
sb.append(", negative=[");
226-
appendsBucketsAsString(sb, neg);
227-
sb.append("]");
228-
}
229-
BucketIterator pos = histogram.positiveBuckets().iterator();
230-
if (pos.hasNext()) {
231-
sb.append(", positive=[");
232-
appendsBucketsAsString(sb, pos);
233-
sb.append("]");
234-
}
235-
sb.append("}");
236-
return sb.toString();
237-
}
238-
239-
private static void appendsBucketsAsString(StringBuilder out, BucketIterator it) {
240-
boolean first = true;
241-
while (it.hasNext()) {
242-
if (first) {
243-
first = false;
244-
} else {
245-
out.append(", ");
246-
}
247-
out.append(it.peekIndex()).append(": ").append(it.peekCount());
248-
it.advance();
249-
}
250-
}
251-
252205
static ExponentialHistogram empty() {
253206
return EmptyExponentialHistogram.INSTANCE;
254207
}

0 commit comments

Comments
 (0)