Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namespace didn't remove experiments from segmentAllocations after invoking RemoveExperiment() #4

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
4 changes: 4 additions & 0 deletions namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ func (n *SimpleNamespace) RemoveExperiment(name string) error {
}
}

for _, val := range segmentsToFree {
delete(n.segmentAllocations, uint64(val))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could delete be done inside the loop where values are added tosegmentsToFree? (instead of iterating segmentsToFree outside separately)
https://github.com/biased-unit/planout-golang/blob/master/namespace.go#L98

}

for i := range segmentsToFree {
n.availableSegments = append(n.availableSegments, segmentsToFree[i])
}
Expand Down