From 1a98d0b660775f9a434197430905024519a0efbf Mon Sep 17 00:00:00 2001 From: Tyge Lovset Date: Wed, 4 Jan 2023 23:27:15 +0100 Subject: Small examples enhancements. --- misc/examples/sso_map.c | 6 +++--- misc/examples/unordered_set.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/examples/sso_map.c b/misc/examples/sso_map.c index 3627d101..f88e5f79 100644 --- a/misc/examples/sso_map.c +++ b/misc/examples/sso_map.c @@ -6,12 +6,12 @@ int main() { c_AUTO (cmap_str, m) { - cmap_str_emplace(&m, "Test short", "This is a short string."); - cmap_str_emplace(&m, "Test long ", "This is a longer string."); + cmap_str_emplace(&m, "Test short", "This is a short string"); + cmap_str_emplace(&m, "Test long ", "This is a longer string"); c_FORPAIR (k, v, cmap_str, m) printf("%s: '%s' Len=%" c_ZU ", Is long: %s\n", cstr_str(_.k), cstr_str(_.v), cstr_size(_.v), - cstr_is_long(_.v)?"true":"false"); + cstr_is_long(_.v) ? "true" : "false"); } } diff --git a/misc/examples/unordered_set.c b/misc/examples/unordered_set.c index 509f97e1..bf054b88 100644 --- a/misc/examples/unordered_set.c +++ b/misc/examples/unordered_set.c @@ -22,7 +22,7 @@ int main() // find returns end iterator if key is not found, // else it returns iterator to that key - if (cset_str_find(&stringSet, key).ref == cset_str_end(&stringSet).ref) + if (cset_str_find(&stringSet, key).ref == NULL) printf("\"%s\" not found\n", key); else printf("Found \"%s\"\n", key); -- cgit v1.2.3