]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/commitdiff
Fix equal drinkers when no top drinkers
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 3 Apr 2019 06:20:41 +0000 (08:20 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 3 Apr 2019 06:20:42 +0000 (08:20 +0200)
CHANGELOG.md
cbgetter.py

index 56a4d16bac4edb3412bdf25c29f681ba3535baf9..814ac462730d88899fed1166529b0ccb4b880435 100644 (file)
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog][] and this project adheres to
 [Semantic Versioning]: http://semver.org/
 
 ## Unreleased
+### Fixed
+- Compute equal drinker when no top drinkers.
 
 ## 0.2.0 - 2019-03-29
 ### Added
index 4622882b1e6b28c88d55d21c696688e5dfe2ab5a..fce31bfc2bb01cbd4bd6ba17cdeab6230bcac9de 100644 (file)
@@ -58,6 +58,8 @@ class CoffeebotGetter:
 
     def computeEqualDrinkers(self):
         """Compute equally drunken drinkers."""
+        if len(self.top) <= 0:
+            return
         lc = self.top[0][1] + 1
         for (un, c) in self.top:
             if c < lc: