diff options
| author | Tyge Løvset <[email protected]> | 2021-12-23 13:21:21 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-12-23 13:21:21 +0100 |
| commit | de411007bceda17457fb27ea72b4433adf744797 (patch) | |
| tree | 9007e2accfcf4bfdb0347554f3ff671b47c610ed /examples/birthday.c | |
| parent | a7b11c557e89dfe6314dd07ea558359071da0f92 (diff) | |
| download | STC-modified-de411007bceda17457fb27ea72b4433adf744797.tar.gz STC-modified-de411007bceda17457fb27ea72b4433adf744797.zip | |
Removed emplace functions if not i_valraw or i_keyraw is defined. Safety/optimize measure.
Diffstat (limited to 'examples/birthday.c')
| -rw-r--r-- | examples/birthday.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/birthday.c b/examples/birthday.c index f9b777c0..f848436c 100644 --- a/examples/birthday.c +++ b/examples/birthday.c @@ -23,7 +23,7 @@ static void test_repeats(void) cmap_ic_reserve(&m, N);
c_forrange (i, N) {
uint64_t k = stc64_rand(&rng) & mask;
- int v = cmap_ic_emplace(&m, k, 0).ref->second += 1;
+ int v = cmap_ic_insert(&m, k, 0).ref->second += 1;
if (v > 1) printf("repeated value %zu (%d) at 2^%d\n", k, v, (int) log2((double) i));
}
}
@@ -44,7 +44,7 @@ void test_distribution(void) c_auto (cmap_x, map) {
c_forrange (N) {
uint64_t k = stc64_rand(&rng);
- cmap_x_emplace(&map, k & 0xf, 0).ref->second += 1;
+ cmap_x_insert(&map, k & 0xf, 0).ref->second += 1;
}
uint64_t sum = 0;
|
