summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-06-22 21:24:23 +0200
committerGitHub <[email protected]>2020-06-22 21:24:23 +0200
commit29034c539ed1ab5a1ce7060b3452728026928ef3 (patch)
tree736541432b3ec3c5283e90bb087bbd3f5c3b0b50
parent23e4aa6a3d3abe83600300660b9b5b30489cae6d (diff)
downloadSTC-modified-29034c539ed1ab5a1ce7060b3452728026928ef3.tar.gz
STC-modified-29034c539ed1ab5a1ce7060b3452728026928ef3.zip
Update README.md
-rw-r--r--README.md4
1 files 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()*.