master - log: skip repeated hashing when logging once
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=700b4bfc9428d7440c018c0a5e9d9dcc3cc4cea1 Commit: 700b4bfc9428d7440c018c0a5e9d9dcc3cc4cea1 Parent: 96cf9dc0170d8a807ecac3956a80c3f51cfe48c0 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Apr 7 17:51:42 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Apr 8 11:00:14 2014 +0200
log: skip repeated hashing when logging once
When a message is already found in the hash, no need to hash it again.
--- lib/log/log.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
lib/log/log.c +2 -1
@@ -268,7 +268,8 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,if (_duplicated) {if (dm_hash_lookup (_duplicated, message)) level = _LOG_NOTICE; - (void )dm_hash_insert (_duplicated, message, (void *)1 ); +else + (void )dm_hash_insert (_duplicated, message, (void *)1 ); } }