Added a tiny improvement from my stupid friends

This commit is contained in:
Hannes 2022-03-23 17:17:53 +01:00
parent 01b0eca079
commit c96a0714b6

View file

@ -373,11 +373,10 @@ impl RatchetEncHeader {
if self.nr + MAX_SKIP < until { if self.nr + MAX_SKIP < until {
return Err("Skipping went wrong") return Err("Skipping went wrong")
} }
if let Some(mut d) = self.ckr { if let Some(d) = &mut self.ckr {
while self.nr < until { while self.nr < until {
let (ckr, mk) = kdf_ck(&d); let (ckr, mk) = kdf_ck(&d);
self.ckr = Some(ckr); *d = ckr;
d = ckr;
self.mkskipped.insert((self.hkr, self.nr), mk); self.mkskipped.insert((self.hkr, self.nr), mk);
self.nr += 1 self.nr += 1
} }