Skip to content

Commit

Permalink
review comment-reorder move code out of ladder.
Browse files Browse the repository at this point in the history
  • Loading branch information
lostluck committed Apr 26, 2024
1 parent 0781bc3 commit a558dab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sdks/go/pkg/beam/runners/prism/internal/engine/holds.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ func newHoldTracker() *holdTracker {
// removed from the heap. Drop panics if holds become negative.
func (ht *holdTracker) Drop(hold mtime.Time, v int) {
n := ht.counts[hold] - v
if n == 0 {
delete(ht.counts, hold)
for i, h := range ht.heap {
if hold == h {
heap.Remove(&ht.heap, i)
break
}
}
} else if n > 0 {
if n > 0 {
ht.counts[hold] = n
} else {
return
} else if n < 0 {
panic(fmt.Sprintf("prism error: negative watermark hold count %v for time %v", n, hold))
}
delete(ht.counts, hold)
for i, h := range ht.heap {
if hold == h {
heap.Remove(&ht.heap, i)
break
}
}
}

// Add a hold a number of times to heap. If the hold time isn't already present in the heap, it is added.
Expand Down

0 comments on commit a558dab

Please sign in to comment.