Skip to content

Commit

Permalink
perf: replace % with bitwise & b/c divisor is power of 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzel committed Feb 26, 2023
1 parent f7f47b7 commit ed61f93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Net {
static _opaque = 0

static opaque () {
Net._opaque = ++Net._opaque % 0xffffffff
Net._opaque = (Net._opaque + 1) & 0xffffffff
return Net._opaque
}

Expand Down

0 comments on commit ed61f93

Please sign in to comment.