History

nextipow2: simplify

Sigrid Solveig Haflínudóttir committed 11 months ago

Commit ff148801 parent 6924b822 files · +2 −5Browse files

Showing the changes to src/hashing.c (1 of 2 files). Show all

Unified · Split

src/hashing.c+2−3
@@ -5,8 +5,6 @@ · 4 unmodified lines
5sl_v5sl_v
6nextipow2(sl_v a)6nextipow2(sl_v a)
7{7{
8 if(sl_unlikely(a == 0))
9 return 1;
10 a |= a >> 1;8 a |= a >> 1;
11 a |= a >> 2;9 a |= a >> 2;
12 a |= a >> 4;10 a |= a >> 4;
@@ -16,7 +14,8 @@ nextipow2(sl_v a) · 3 unmodified lines
16 a |= a >> 32;14 a |= a >> 32;
17#endif15#endif
18 a++;16 a++;
19 return a ? a : TOP_BIT;17 assert(a != 0);
18 return a;
20}19}
21 20
22sl_v21sl_v

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t