Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bringbart
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
1.
▲
by
bringbart
11mo ago
unsigned is easier: 'if(index >= max)' and has fewer edge cases because you don't need to worry about undefined behavior when computing index.
2.
▲
by
bringbart
11mo ago
>while unsigned wraparound leads to bugs which are basically impossible to find. What? unsigned sizes are way easier to check, you just need one invariant: if(x < capacity) // good to go Always works, regardless how x is cal