Skip to content

Commit

Permalink
fix: removed the -vn flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxx committed Apr 11, 2023
1 parent e2c52a2 commit 71f17a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/Paxx-RnD/go-helper/helpers/math_helper/mathint"
"github.com/Paxx-RnD/go-helper/helpers/slice_helper"
"github.com/Paxx-RnD/peak-tracer/types"
"os"
Expand Down Expand Up @@ -82,15 +83,17 @@ func main() {

var max float64
i := 0
for i = range ranges {
for range ranges {
max += flags.After + flags.Before
if max > float64(flags.Target) {
break
}
i++
}

fmt.Printf("ranges len: %d, i: %d\n", len(ranges), i)
if i > len(ranges)-1 {
i = len(ranges) - 1
i = mathint.Max(0, len(ranges)-1)
}

ranges = ranges[:i]
Expand Down

0 comments on commit 71f17a9

Please sign in to comment.