]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/hashmap.c
hashmap: optimize set_put_strdup() a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 29 Apr 2016 15:33:29 +0000 (17:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 Apr 2016 15:35:32 +0000 (17:35 +0200)
commit454f0f8680ebbded135e8575b4d9615b427fdf76
tree1001934d129716b22fbab80554ce7da2df4a8929
parent934e749e18bc0641a3dc8d83c4f16a2ba4c8d966
hashmap: optimize set_put_strdup() a bit

Hashing should be quicker than allocating, hence let's first check if the
string already exists and only then allocate a new copy for it.
src/basic/hashmap.c