diff options
| author | Tyge Løvset <[email protected]> | 2020-06-22 21:24:23 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-22 21:24:23 +0200 |
| commit | 29034c539ed1ab5a1ce7060b3452728026928ef3 (patch) | |
| tree | 736541432b3ec3c5283e90bb087bbd3f5c3b0b50 | |
| parent | 23e4aa6a3d3abe83600300660b9b5b30489cae6d (diff) | |
| download | STC-modified-29034c539ed1ab5a1ce7060b3452728026928ef3.tar.gz STC-modified-29034c539ed1ab5a1ce7060b3452728026928ef3.zip | |
Update README.md
| -rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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()*.
|
