summaryrefslogtreecommitdiff
path: root/examples/gehashmap.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-12-24 02:25:49 +0100
committerThomas Voss <mail@thomasvoss.com> 2022-12-24 02:25:49 +0100
commit144bd88ff5146af4df99596606a7bf2a624723fc (patch)
treea8cadc390525894bb7f63b599505bdc5b9eb8677 /examples/gehashmap.c
parent2ba320056c0f08c6171fd61766eb880f88b54b75 (diff)
Simplify hashmaps by not freeing keys
Diffstat (limited to 'examples/gehashmap.c')
-rw-r--r--examples/gehashmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/gehashmap.c b/examples/gehashmap.c
index b7a86ff..1ddd391 100644
--- a/examples/gehashmap.c
+++ b/examples/gehashmap.c
@@ -62,9 +62,9 @@ main(void)
atoimap_new(map_a = malloc(sizeof(atoimap_t)));
itoumap_new(map_b = malloc(sizeof(itoumap_t)));
- atoimap_set(map_a, strdup("Thomas Voß"), 5);
- atoimap_set(map_a, strdup("THOMAS VOẞ"), 6);
- atoimap_set(map_a, strdup("Thomas Voss"), 7);
+ atoimap_set(map_a, "Thomas Voß", 5);
+ atoimap_set(map_a, "THOMAS VOẞ", 6);
+ atoimap_set(map_a, "Thomas Voss", 7);
atoimap_get(map_a, "Thomas Voß", &i); printf("Thomas Voß -> %d\n", i);
atoimap_get(map_a, "THOMAS VOẞ", &i); printf("THOMAS VOẞ -> %d\n", i);
atoimap_get(map_a, "Thomas Voss", &i); printf("Thomas Voss -> %d\n", i);