diff --git a/.bleep b/.bleep index 74fe28f..8a5222b 100644 --- a/.bleep +++ b/.bleep @@ -1 +1 @@ -d2b0975beaec744968a4936eb80483fac65f7e35 \ No newline at end of file +802590d7d04730c3e93f9c2335175990eee1fb92 \ No newline at end of file diff --git a/pingora-lru/src/lib.rs b/pingora-lru/src/lib.rs index bdf330a..d7c31c7 100644 --- a/pingora-lru/src/lib.rs +++ b/pingora-lru/src/lib.rs @@ -68,7 +68,7 @@ impl Lru { // Make sure weight is positive otherwise eviction won't work // TODO: Probably should use NonZeroUsize instead - let weight = if weight == 0 { 1 } else { weight }; + let weight = weight.max(1); let old_weight = unit.admit(key, data, weight); if old_weight != weight {