-
Notifications
You must be signed in to change notification settings - Fork 111
network/bitvector: Multibit set/unset + string rep #1530
network/bitvector: Multibit set/unset + string rep #1530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@nolash I personally prefer naming methods, than using |
network/bitvector/bitvector.go
Outdated
// SetBytes modifies all bits in the bitvector that are set in the argument | ||
// | ||
// If v is true, it sets all bits in the bitvector that are set in the argument | ||
// If v is false, it unsets all bites in the bitvector that are set in the argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - bites
-> bits
.
Unset 1010101001
is easier to reason about than SetBytes 1010101001 false
IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it because the corresponding one for individual bits is Set(int, bool)
- should we change that too, then? I think they should be the same.
And yes I agree Unset
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* master: network/newstream: new stream! protocol base implementation (#1500) swarm: fix bzz_info.port when using dynamic port allocation (#1537) cmd/swarm: make bzzaccount flag optional and add bzzkeyhex flag (#1531) cmd/swarm: remove separate function to parse env vars (#1536) network/bitvector: Multibit set/unset + string rep (#1530) swarm: 0.4.3 unstable (#1526) travis: also build on release tags (#1527) swarm: release v0.4.2 (#1496) network: bump bzz stream hive (#1522) docker: update ca-certificates file (#1525) Add swarm guide to /docs (#1513) network/simulation: Add ExecAdapter capability to swarm simulations (#1503)
Adaptive capabilities' use of bitvectors require setting multiple bits in one command, and also string output for logging. This PR adds this functionality to the bitvector package as a preparatory step.