aboutsummaryrefslogtreecommitdiff
path: root/src/https.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-08 22:29:08 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-08 22:29:08 +0100
commit62c745898d35287577caa0bd384cc7bc39f6b4ec (patch)
treec2730e745f39ff54ad000cb38150b77c385958df /src/https.rs
parent7dbf848de3137158d1e12c2cd547ab4778fcf5a0 (diff)
downloadtricot-62c745898d35287577caa0bd384cc7bc39f6b4ec.tar.gz
tricot-62c745898d35287577caa0bd384cc7bc39f6b4ec.zip
Inverse how priorities work
Diffstat (limited to 'src/https.rs')
-rw-r--r--src/https.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/https.rs b/src/https.rs
index 7d64e44..e1db42e 100644
--- a/src/https.rs
+++ b/src/https.rs
@@ -100,15 +100,14 @@ async fn handle(
.map(|prefix| path.starts_with(prefix))
.unwrap_or(true)
})
- .min_by_key(|ent| {
+ .max_by_key(|ent| {
(
ent.priority,
- -(ent
- .path_prefix
+ ent.path_prefix
.as_ref()
.map(|x| x.len() as i32)
- .unwrap_or(0)),
- ent.calls.load(Ordering::SeqCst),
+ .unwrap_or(0),
+ -ent.calls.load(Ordering::SeqCst),
)
});