mirror of
https://github.com/mikedilger/chorus.git
synced 2026-08-01 07:21:39 +00:00
Optimization available for when loading author-kind-replaceable events
This commit is contained in:
parent
4cfc8a0074
commit
941515003a
@ -176,7 +176,7 @@ impl Store {
|
||||
}
|
||||
} else if filter.num_authors() > 0 && filter.num_kinds() > 0 {
|
||||
for author in filter.authors() {
|
||||
for kind in filter.kinds() {
|
||||
'kind: for kind in filter.kinds() {
|
||||
let start_prefix = Self::key_akci(
|
||||
author,
|
||||
kind,
|
||||
@ -201,6 +201,14 @@ impl Store {
|
||||
// check against the rest of the filter
|
||||
if filter.event_matches(&event)? {
|
||||
output.push(event);
|
||||
// If kind is replaceable (and not parameterized)
|
||||
// then don't take any more events for this author-kind
|
||||
// pair.
|
||||
// NOTE that this optimization is difficult to implement
|
||||
// for other replaceable event situations
|
||||
if kind.is_replaceable() {
|
||||
continue 'kind;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Stop if limited
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user