diff options
| author | Tyge Lovset <[email protected]> | 2022-10-07 07:32:45 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-10-07 07:32:45 +0200 |
| commit | 12d854b17371903253cd54e8cbb1a947b637de83 (patch) | |
| tree | 50bcfa6ef6829287f6cc7eb8033cc0f95f7b039f /examples | |
| parent | 905fe02e9c258c8ac8d7aebb439c7039f7109cb1 (diff) | |
| download | STC-modified-12d854b17371903253cd54e8cbb1a947b637de83.tar.gz STC-modified-12d854b17371903253cd54e8cbb1a947b637de83.zip | |
Rename c_find_in() to overload c_find_if().
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/books.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/books.c b/examples/books.c index eed19540..90d2d529 100644 --- a/examples/books.c +++ b/examples/books.c @@ -42,8 +42,8 @@ int main() // Look up the values associated with some keys. const char* to_find[] = {"Pride and Prejudice", "Alice's Adventure in Wonderland"}; c_forloop (i, c_arraylen(to_find)) { - const cmap_str_value* b; - if ((b = cmap_str_get(&book_reviews, to_find[i]))) + const cmap_str_value* b = cmap_str_get(&book_reviews, to_find[i]); + if (b) printf("%s: %s\n", cstr_str(&b->first), cstr_str(&b->second)); else printf("%s is unreviewed.\n", to_find[i]); |
