summaryrefslogtreecommitdiffhomepage
path: root/examples/words.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-09-06 23:32:30 +0200
committerTyge Løvset <[email protected]>2020-09-06 23:32:30 +0200
commit5b78847871217562dcddbb0bd34076a892eb49e1 (patch)
tree66204cf3a2c0a8d847f8e423856249d11fa8946d /examples/words.c
parentc42c18bb94606b45454da937690f872b5ebd59d1 (diff)
downloadSTC-modified-5b78847871217562dcddbb0bd34076a892eb49e1.tar.gz
STC-modified-5b78847871217562dcddbb0bd34076a892eb49e1.zip
Renamed push_****(), _insert() to _emplace(). added insert_or_assign(), etc.
Diffstat (limited to 'examples/words.c')
-rw-r--r--examples/words.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/words.c b/examples/words.c
index 275ffee7..92f98c85 100644
--- a/examples/words.c
+++ b/examples/words.c
@@ -16,7 +16,7 @@ int main1()
"this", "sentence", "is", "not", "a", "sentence",
"this", "sentence", "is", "a", "hoax"
));
- clist_str_push_back_v(&lwords, cstr_from("%f", 123897.0 / 23.0));
+ clist_str_push_back(&lwords, cstr_from("%f", 123897.0 / 23.0));
c_foreach (w, clist_str, lwords)
printf("%s\n", w.item->value.str);
puts("");
@@ -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)->value;
+ ++cmap_si_emplace(&word_map, w.item->str, 0).item->value;
c_foreach (pair, cmap_si, word_map) {
printf("%d occurrences of word '%s'\n",