Skip to content

refactor: use byteorder crate to enhance portability (to BE systems), and enhance code readability, avoiding manual byte manipulations#250

Merged
ikatson merged 1 commit intoikatson:mainfrom
PastaPastaPasta:refactor/byteorder
Oct 3, 2024
Merged

Conversation

@PastaPastaPasta
Copy link
Copy Markdown
Contributor

@PastaPastaPasta PastaPastaPasta commented Oct 3, 2024

Note: this also fixes what I think is a small bug here: https://github.com/ikatson/rqbit/pull/250/files#diff-b4f79704f8a70bb6832cd8eb994612ba62b1e199efcebd39228d0761a257920dR285

where 6 is always printed instead of the invalid size like other instances do

… and enhance code readability, avoiding manual byte manipulations
@ikatson
Copy link
Copy Markdown
Owner

ikatson commented Oct 3, 2024

nit: if I wrote this today, I'd just use std's to_be_bytes / from_be_bytes to avoid adding a dependency. I guess I didn't know about these functions when I wrote this originally years ago.
Also afaik your change doesn't increase portability as the commit name states, it should have worked on be systems already (in theory).

But the change looks ok anyway, the above is just FYI, merging

@ikatson ikatson merged commit 932836d into ikatson:main Oct 3, 2024
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.

2 participants