kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject [kafka] branch trunk updated: MINOR: Make Histogram#clear more readable (#9679)
Date Fri, 04 Dec 2020 03:55:53 GMT
This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new b18ecad  MINOR: Make Histogram#clear more readable (#9679)
b18ecad is described below

commit b18ecad90ecf1698319ef2fc19c6ab9220242af1
Author: Geordie <g1geordie@gmail.com>
AuthorDate: Fri Dec 4 11:54:44 2020 +0800

    MINOR: Make Histogram#clear more readable (#9679)
    
    Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
---
 .../main/java/org/apache/kafka/common/metrics/stats/Histogram.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java b/clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java
index b539d4e..97f9182 100644
--- a/clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java
+++ b/clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java
@@ -16,6 +16,8 @@
  */
 package org.apache.kafka.common.metrics.stats;
 
+import java.util.Arrays;
+
 public class Histogram {
 
     private final BinScheme binScheme;
@@ -55,8 +57,7 @@ public class Histogram {
     }
 
     public void clear() {
-        for (int i = 0; i < this.hist.length; i++)
-            this.hist[i] = 0.0f;
+        Arrays.fill(this.hist, 0.0f);
         this.count = 0;
     }
 


Mime
View raw message