mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
floats: fix floats.Slice truncate
This commit is contained in:
parent
e320e5d249
commit
9c43c75361
|
@ -192,7 +192,7 @@ func (s Slice) Last(i int) float64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Slice) Truncate(size int) Slice {
|
func (s Slice) Truncate(size int) Slice {
|
||||||
if len(s) < size {
|
if size < 0 || len(s) <= size {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user