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

fix prefix option #57

Merged
merged 2 commits into from
Jul 14, 2018
Merged

fix prefix option #57

merged 2 commits into from
Jul 14, 2018

Conversation

michaelfung
Copy link
Contributor

set prefix option according to etcd API

@foobargeez
Copy link
Contributor

foobargeez commented Jul 13, 2018

Your approach is much simpler and cleaner -- thanks. I currently use a much-complicated solution :-/ -- something like below:

sub BinaryToASCII ($bin) {
  return unpack("A*", pack("B*", $bin));
}

$range_end = BinaryToASCII("0" . Math::BigInt->from_bin($range_key)->binc()->to_bin());

I should have raised a PR to be included in the module earlier (or a simplified version of it) :-/

Copy link
Owner

@hexfusion hexfusion left a comment

Choose a reason for hiding this comment

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

@michaelfung, thanks for the contribution! This looks good, could you also update the POD on the prefix accessor while we are here?

=head2 prefix
This is a helper accessor which is an alias for range_end => "\0" if passed a true value.
If range_end is also passed prefix will superceed it's value.
=cut

@hexfusion
Copy link
Owner

ref: #53

@hexfusion hexfusion merged commit bfb8c73 into hexfusion:master Jul 14, 2018
@hexfusion
Copy link
Owner

@michaelfung, thanks again. I will cut a new release for CPAN Monday morning.

@hexfusion
Copy link
Owner

@michaelfung https://github.com/hexfusion/perl-net-etcd/releases/tag/v0.022 is on it's way to CPAN. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants