Fix history overflowing
This commit is contained in:
parent
c2245ec304
commit
2224d2e73e
@ -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:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user