mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 11:09:20 +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
|
private var lastTick = OcelotDesktop.ticker.tick
|
||||||
|
|
||||||
def appendHistoryValue(value: Float): Unit = {
|
def appendHistoryValue(value: Float): Unit = {
|
||||||
history.append(value)
|
if (history.length > historySize) {
|
||||||
|
history.remove(0)
|
||||||
|
}
|
||||||
|
|
||||||
if (history.length > historySize)
|
history.append(value)
|
||||||
history.drop(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def tickUpdate(): Unit = {}
|
def tickUpdate(): Unit = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user