Skip to content

Commit

Permalink
fix: remove no-op if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Jul 27, 2022
1 parent 0733642 commit 651e419
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/parcacol/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,12 @@ func validatePprofProfile(p *pprofproto.Profile) error {
if len(s.Value) != sampleLen {
return fmt.Errorf("mismatch: sample has %d values vs. %d types", len(s.Value), len(p.SampleType))
}
if len(s.LocationId) > 0 {
for j, l := range s.LocationId {
if l == 0 {
return fmt.Errorf("location ids of stacktraces must be non-zero")
}
if l > locationsNum {
return fmt.Errorf("sample %d location number %d (%d) is out of range", i, j, l)
}
for j, l := range s.LocationId {
if l == 0 {
return fmt.Errorf("location ids of stacktraces must be non-zero")
}
if l > locationsNum {
return fmt.Errorf("sample %d location number %d (%d) is out of range", i, j, l)
}
}
for j, label := range s.Label {
Expand Down

0 comments on commit 651e419

Please sign in to comment.