cleaned up the source_lookup
This commit is contained in:
parent
9d1c80076a
commit
37e8ff83f0
|
@ -179,7 +179,7 @@ const struct source *source_lookup(struct sources *const s,
|
||||||
it = source_tree_less(&s->dates, x);
|
it = source_tree_less(&s->dates, x);
|
||||||
/* If it's before all elements of the journal or is not on the same date as
|
/* If it's before all elements of the journal or is not on the same date as
|
||||||
the source, this has no source, which is `list[0]` by <fn:sources>. */
|
the source, this has no source, which is `list[0]` by <fn:sources>. */
|
||||||
if(!source_tree_has_element(&it)
|
return s->list.data + (source_tree_has_element(&it)
|
||||||
|| x.date.u32 != source_tree_key(&it).date.u32) return s->list.data + 0;
|
&& x.date.u32 == source_tree_key(&it).date.u32
|
||||||
return s->list.data + *source_tree_value(&it);
|
? *source_tree_value(&it) : 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue