diff options
| author | Tyge Løvset <[email protected]> | 2020-09-10 20:48:44 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-10 20:48:44 +0200 |
| commit | 8dd8368bca262dbab39741fbbb61c16478772e4e (patch) | |
| tree | fa7b82f835a002f60a70d1b1b159fbb4a26f9bf5 /examples/words.c | |
| parent | 0b3e84cac29288af49bbabf2f880cd6319f9a1f3 (diff) | |
| download | STC-modified-8dd8368bca262dbab39741fbbb61c16478772e4e.tar.gz STC-modified-8dd8368bca262dbab39741fbbb61c16478772e4e.zip | |
Use cmap_emplace() rather than cmap_insert(). insert() is reduced to an alias of emplace() because it makes no sense using the std::unordered_map API.
Diffstat (limited to 'examples/words.c')
| -rw-r--r-- | examples/words.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/words.c b/examples/words.c index af637b8d..9e0fc0cc 100644 --- a/examples/words.c +++ b/examples/words.c @@ -29,7 +29,7 @@ int main1() cmap_si word_map = cmap_ini; c_foreach (w, cvec_str, words) - cmap_si_insert(&word_map, w.item->str, 0).item->value += 1; + cmap_si_emplace(&word_map, w.item->str, 0).item->value += 1; c_foreach (pair, cmap_si, word_map) { printf("%d occurrences of word '%s'\n", |
