fix fuckedtail
This commit is contained in:
parent
aa1a2ec9a1
commit
7317e44760
|
@ -3,13 +3,17 @@ class Buffer
|
|||
@limit = limit
|
||||
@data = {}
|
||||
|
||||
purge: =>
|
||||
if #@data > @limit
|
||||
table.remove @data, 1
|
||||
@purge!
|
||||
else return
|
||||
|
||||
add: (line) =>
|
||||
if #@data == @limit
|
||||
table.remove @data, 0
|
||||
|
||||
table.insert @data, line
|
||||
@purge!
|
||||
|
||||
with Buffer 10
|
||||
with Buffer 5
|
||||
while true
|
||||
n = io.read!
|
||||
if n ~= nil
|
||||
|
|
Loading…
Reference in New Issue