Python indexes from zero...

Sun, 21 Jan 2018 17:19:22 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 21 Jan 2018 17:19:22 +0000
changeset 35
495a510a6d01
parent 34
9fce700d42de
child 36
1478f8722690

Python indexes from zero...

fifolog.py file | annotate | diff | comparison | revisions
--- a/fifolog.py	Sun Jan 21 16:21:53 2018 +0000
+++ b/fifolog.py	Sun Jan 21 17:19:22 2018 +0000
@@ -12,7 +12,7 @@
         self.buffer.append(record)
         l=len(self.buffer)
         if l>self.capacity:
-            self.buffer=self.buffer[(l-self.capacity+1):l]
+            self.buffer=self.buffer[(l-self.capacity):(l-1)]
 
     def formatAll(self):
         return [self.format(record) for record in self.buffer]

mercurial