Fix history overflowing

This commit is contained in:
Sasha Koshka 2024-09-12 02:56:56 -04:00
parent c2245ec304
commit 2224d2e73e

View File

@ -49,6 +49,7 @@ func (this *History[T]) Push (item T) {
} }
if len(this.stack) > this.max { if len(this.stack) > this.max {
this.topIndex --
this.stack = this.stack[1:] this.stack = this.stack[1:]
} }
} }