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