mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 06:53:01 +02:00
fix as conversions
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
7397064edd
commit
dcd7422c45
11 changed files with 107 additions and 51 deletions
|
@ -43,11 +43,11 @@ impl Service {
|
|||
|
||||
#[tracing::instrument(skip_all, name = "auth_chain")]
|
||||
pub async fn get_auth_chain(&self, room_id: &RoomId, starting_events: &[&EventId]) -> Result<Vec<u64>> {
|
||||
const NUM_BUCKETS: u64 = 50; //TODO: change possible w/o disrupting db?
|
||||
const NUM_BUCKETS: usize = 50; //TODO: change possible w/o disrupting db?
|
||||
const BUCKET: BTreeSet<(u64, &EventId)> = BTreeSet::new();
|
||||
|
||||
let started = std::time::Instant::now();
|
||||
let mut buckets = [BUCKET; NUM_BUCKETS as usize];
|
||||
let mut buckets = [BUCKET; NUM_BUCKETS];
|
||||
for (i, &short) in services()
|
||||
.rooms
|
||||
.short
|
||||
|
@ -55,8 +55,9 @@ impl Service {
|
|||
.iter()
|
||||
.enumerate()
|
||||
{
|
||||
let bucket = validated!(short % NUM_BUCKETS)?;
|
||||
buckets[bucket as usize].insert((short, starting_events[i]));
|
||||
let bucket: usize = short.try_into()?;
|
||||
let bucket: usize = validated!(bucket % NUM_BUCKETS)?;
|
||||
buckets[bucket].insert((short, starting_events[i]));
|
||||
}
|
||||
|
||||
debug!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue