summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65fa52f)
raw | patch | inline | side by side (parent: 65fa52f)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 4 Jul 2014 18:57:41 +0000 (20:57 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 4 Jul 2014 18:57:41 +0000 (20:57 +0200) |
When handling dynamically allocated data, this would generate unnecessary
memory churn.
memory churn.
src/core/store.c | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index 7de75b1ee546e6a49509746fa0a13410834ba779..1c04a77cb6a6c1ce252380211ee8bdb9de188309 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
if (status)
return status;
+ /* don't update unchanged values */
+ if (! sdb_data_cmp(&ATTR(attr)->value, value))
+ return status;
+
assert(attr);
if (sdb_data_copy(&ATTR(attr)->value, value))
return -1;