Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: micro-optimize high water mark calculation
Don't iterate over all 32 bits, use some hacker's delight bit twiddling to compute the next power of two. The logic can be reduced to `n = 1 << 32 - Math.clz32(n)` but then it can't easily be backported to v2.x; Math.clz32() was added in V8 4.3. PR-URL: #2479 Reviewed-By: Chris Dickinson <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
- Loading branch information