indicator: simplify add klines

This commit is contained in:
c9s 2023-06-29 17:55:55 +08:00
parent eafd777046
commit f91a4c2979
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -37,9 +37,7 @@ func (s *KLineStream) AddSubscriber(f func(k types.KLine)) {
} }
func (s *KLineStream) AddBackLog(kLines []types.KLine) { func (s *KLineStream) AddBackLog(kLines []types.KLine) {
for _, k := range kLines { s.kLines = append(s.kLines, kLines...)
s.kLines = append(s.kLines, k)
}
} }
// KLines creates a KLine stream that pushes the klines to the subscribers // KLines creates a KLine stream that pushes the klines to the subscribers