chiark / gitweb /
util: optimize free_and_strdup() if NOP
authorLennart Poettering <lennart@poettering.net>
Mon, 11 May 2015 18:09:58 +0000 (20:09 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 07:54:18 +0000 (08:54 +0100)
commit249a98a8ff9f9a3da30e977d347c14487088f738
tree39b72cb644107d0c4185aff75e30e0b2c21776f6
parenteba20c2f8afe24a8bab713946a248b45dd2a80f1
util: optimize free_and_strdup() if NOP

Under the assumption that strcmp() is cheaper than memory allocation,
let's avoid the allocation, if the new value is identical to the old.
src/shared/util.c