summaryrefslogtreecommitdiff
path: root/src/journal/sd-journal.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-27 19:02:10 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-01 22:42:33 +0100
commited71f95662af903f0c5eba32c439e77c5cec4e7b (patch)
treeeae9903453eb45d9dd61035c7ec25718090ff410 /src/journal/sd-journal.c
parent69e714f3d8784fb0207ac9112ed1a48d4fd5e9fe (diff)
sd-journal: minor optimization
No need to store the object and offset data if we don't actually need it ever.
Diffstat (limited to 'src/journal/sd-journal.c')
-rw-r--r--src/journal/sd-journal.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 85d9bbe04f..7a3aaf0cab 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2520,24 +2520,20 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_
* traversed files. */
found = false;
ORDERED_HASHMAP_FOREACH(of, j->files, i) {
- Object *oo;
- uint64_t op;
-
if (of == j->unique_file)
break;
- /* Skip this file it didn't have any fields
- * indexed */
- if (JOURNAL_HEADER_CONTAINS(of->header, n_fields) &&
- le64toh(of->header->n_fields) <= 0)
+ /* Skip this file it didn't have any fields indexed */
+ if (JOURNAL_HEADER_CONTAINS(of->header, n_fields) && le64toh(of->header->n_fields) <= 0)
continue;
- r = journal_file_find_data_object_with_hash(of, odata, ol, le64toh(o->data.hash), &oo, &op);
+ r = journal_file_find_data_object_with_hash(of, odata, ol, le64toh(o->data.hash), NULL, NULL);
if (r < 0)
return r;
-
- if (r > 0)
+ if (r > 0) {
found = true;
+ break;
+ }
}
if (found)