Skip to content

Commit

Permalink
address comments from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Mar 9, 2023
1 parent e3a3122 commit 96e5ab1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nomad/structs/bitmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (b Bitmap) IndexesInRangeFiltered(set bool, from, to uint, filter []int) []
var indexes []int
for i := from; i <= to && i < b.Size(); i++ {
c := b.Check(i)
if c && set || !c && !set {
if c == set {
if len(filter) < 1 || !slices.Contains(filter, int(i)) {
indexes = append(indexes, int(i))
}
Expand Down
2 changes: 1 addition & 1 deletion nomad/structs/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ func getDynamicPortsStochastic(nodeUsed Bitmap, portsInOffer []int, minDynamicPo
}
// the pick conflicted with a previous pick that hasn't been saved to
// the index yet
if portsInOffer != nil && slices.Contains(portsInOffer, randPort) {
if slices.Contains(portsInOffer, randPort) {
goto PICK
}

Expand Down

0 comments on commit 96e5ab1

Please sign in to comment.