bdoyle0182 commented on code in PR #5396:
URL: https://github.com/apache/openwhisk/pull/5396#discussion_r1169424562


##########
common/scala/src/main/scala/org/apache/openwhisk/common/AverageRingBuffer.scala:
##########
@@ -32,18 +32,12 @@ object AverageRingBuffer {
 class AverageRingBuffer(private val maxSize: Int) {
   private var elements = Vector.empty[Double]
   private var sum = 0.0
-  private var max = 0.0
-  private var min = 0.0
 
   def nonEmpty: Boolean = elements.nonEmpty
 
   def average: Double = {
     val size = elements.size

Review Comment:
   the only place this function is called, it does a `nonEmpty` check first or 
skips over it. Now debatably that check should also be happening inside this 
function for sure to prevent the divide by zero; but since it's not an existing 
issue for the moment I'm going to merge this in to get this fixed.



-- 
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]

Reply via email to