diff options
| author | Tyge Løvset <[email protected]> | 2021-03-29 09:31:20 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-03-29 09:31:20 +0200 |
| commit | 535af062240a244bb8397634ceec985e5a7f30ed (patch) | |
| tree | cc6b4ef208207ca0324942b1b7365f1727dcc98b | |
| parent | 61e27754d91185729a5570d2e9147ee6f85a4faf (diff) | |
| download | STC-modified-535af062240a244bb8397634ceec985e5a7f30ed.tar.gz STC-modified-535af062240a244bb8397634ceec985e5a7f30ed.zip | |
Forgot a test.
| -rw-r--r-- | stc/cbits.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stc/cbits.h b/stc/cbits.h index c1ff05ac..c15441f2 100644 --- a/stc/cbits.h +++ b/stc/cbits.h @@ -204,7 +204,7 @@ STC_DEF cbits_t cbits_clone(cbits_t other) { STC_DEF size_t cbits_count(cbits_t s) {
size_t count = 0, n = s.size >> 6;
for (size_t i = 0; i < n; ++i) count += cpopcount64(s._arr[i]);
- count += cpopcount64(s._arr[n] & ((1ull << (s.size & 63)) - 1));
+ if (s.size & 63) count += cpopcount64(s._arr[n] & ((1ull << (s.size & 63)) - 1));
return count;
}
|
