StateResolution's methods take &self now + more clean up

This commit is contained in:
Devin Ragotzy 2020-08-05 23:34:49 -04:00
parent 8a9f15e01f
commit 185047918a
3 changed files with 6 additions and 2 deletions

View File

@ -15,7 +15,6 @@ repository = "https://github.com/ruma/state-res"
[dependencies]
itertools = "0.9.0"
js_int = "0.1.8"
petgraph = "0.5.1"
serde = { version = "1.0.114", features = ["derive"] }
serde_json = "1.0.56"
tracing = "0.1.16"
@ -29,7 +28,6 @@ branch = "pdu-deserialize"
features = ["client-api", "federation-api", "appservice-api"]
[dev-dependencies]
lazy_static = "1.4.0"
criterion = "0.3.3"
[[bench]]

View File

@ -352,6 +352,12 @@ impl StateResolution {
(-*pl, *ev.origin_server_ts(), ev.event_id().cloned())
);
// count_0.sort_by(|(x, _), (y, _)| {
// x.power_level
// .cmp(&a.power_level)
// .then_with(|| x.origin_server.ts.cmp(&y.origin_server_ts))
// .then_with(|| x.event_id.cmp(&y.event_id))
// This return value is the key used for sorting events,
// events are then sorted by power level, time,
// and lexically by event_id.