use `BTreeMap.drain_filter` for selective db update, rather than clearing everything and replenishing. ref: rust-lang / rust / 70530
use
BTreeMap.drain_filterfor selective db update, rather than clearing everything and replenishing.ref: rust-lang / rust / 70530