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

lib: use buffer-xor over inline #9

Merged
merged 1 commit into from Aug 13, 2015
Merged

lib: use buffer-xor over inline #9

merged 1 commit into from Aug 13, 2015

Conversation

dcousens
Copy link
Contributor

I've written this function enough times :), why not? Eh @jprichardson haha

edit: Maybe wait out on browserify/buffer-xor#1?

@dcousens
Copy link
Contributor Author

It is interesting, because in other languages with a less verbose syntax, it might just be as simple as:

D-lang

int[3] c = a[] ^ b[]

Or say in Python w/ numpy:

c = numpy.bitwise_xor(a, b)

Or if there wasn't that overhead for functional idioms, and the lack of decent binary arrays in JS, using ES6:

c = a.map((x, i) => a[i] ^ b[i])

But, alas. We don't have these things, and this stuff can be finicky. So, what do?

It is 10 lines of code, that were previously untested in isolation, they are now tested and consistent.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4852427 on bufxor into 9c4af83 on master.

@dcousens
Copy link
Contributor Author

dcousens commented Jun 5, 2015

@jprichardson thoughts?

@jprichardson
Copy link
Member

Yeah, I'm fine with it.

dcousens added a commit that referenced this pull request Aug 13, 2015
lib: use buffer-xor over inline
@dcousens dcousens merged commit 442319f into master Aug 13, 2015
@dcousens dcousens deleted the bufxor branch August 13, 2015 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants