Skip to content

Commit

Permalink
docs: fix comment in the wrong spot
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Aug 31, 2024
1 parent a051760 commit 5de78ce
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,11 @@ fn relay_setup(pool: &mut RelayPool, ctx: &egui::Context) {
}
}

/// Should we since optimize? Not always. For examplem if we only have a few
/// notes locally. One way to determine this is by looking at the current filter
/// and seeing what its limit is. If we have less notes than the limit,
/// we might want to backfill older notes
fn send_initial_filters(damus: &mut Damus, relay_url: &str) {
info!("Sending initial filters to {}", relay_url);
let mut c: u32 = 1;

let can_since_optimize = damus.since_optimize;

for relay in &mut damus.pool.relays {
let relay = &mut relay.relay;
if relay.url == relay_url {
Expand All @@ -124,6 +120,13 @@ fn send_initial_filters(damus: &mut Damus, relay_url: &str) {
}

let notes = timeline.notes(ViewFilter::NotesAndReplies);

// Should we since optimize? Not always. For example
// if we only have a few notes locally. One way to
// determine this is by looking at the current filter
// and seeing what its limit is. If we have less
// notes than the limit, we might want to backfill
// older notes
if can_since_optimize && crate::filter::should_since_optimize(lim, notes.len()) {
filter = crate::filter::since_optimize_filter(filter, notes);
} else {
Expand Down

0 comments on commit 5de78ce

Please sign in to comment.