From 29034c539ed1ab5a1ce7060b3452728026928ef3 Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Mon, 22 Jun 2020 21:24:23 +0200 Subject: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c35a8c81..0d551db4 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ cstring_destroy(&lookup); ``` The predefined shorthand macro *declare_CHash_string()* defines a CHash container with a CString as key, however you may use it like: ``` -chash_si_put(&map, "mykey", 12); -int x = chash_si_get(&map, "mykey")->value; // no allocation of string key happens here. +chash_si_put(&map, "mykey", 12); // constructs a CString key from the char* internally. +int x = chash_si_get(&map, "mykey")->value; // no allocation of string key happens here, which is good. ``` An alternative would be to use *char* * as key type, but you would have to manage the memory of the hash char* keys yourself. Note that this customization is also available for **CVector**, but only affects the *find()* function currently. See *declare_CVector_string()*. -- cgit v1.2.3