Skip to content

Commit 3306946

Browse files
authored
fix: use more efficient range over SplitSeq (#287)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent 0014b06 commit 3306946

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/api/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ func TestRestoreWallet(t *testing.T) {
248248
}
249249

250250
func parseMetric(metricsData []byte, metricName string) float64 {
251-
lines := strings.Split(string(metricsData), "\n")
252-
for _, line := range lines {
251+
lines := strings.SplitSeq(string(metricsData), "\n")
252+
for line := range lines {
253253
// Skip empty lines or comment lines that start with "#"
254254
if len(line) == 0 || strings.HasPrefix(line, "#") {
255255
continue

0 commit comments

Comments
 (0)