mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 02:59:19 +01:00
Fix a memory leak
`drop` does not remove an element in-place. To learn what it does, I'll refer you to the scala collection docs.
This commit is contained in:
parent
a1b1b86b6b
commit
08539a025a
@ -51,10 +51,11 @@ class ComputerWindow(computerAware: ComputerAware) extends BasicWindow {
|
||||
private var lastTick = OcelotDesktop.ticker.tick
|
||||
|
||||
def appendHistoryValue(value: Float): Unit = {
|
||||
history.append(value)
|
||||
if (history.length > historySize) {
|
||||
history.remove(0)
|
||||
}
|
||||
|
||||
if (history.length > historySize)
|
||||
history.drop(0)
|
||||
history.append(value)
|
||||
}
|
||||
|
||||
def tickUpdate(): Unit = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user