1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

log: skip repeated hashing when logging once

When a message is already found in the hash, no need to hash it again.
This commit is contained in:
Zdenek Kabelac 2014-04-07 17:51:42 +02:00
parent 96cf9dc017
commit 700b4bfc94

View File

@ -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);
}
}