use drain instead

This commit is contained in:
Edward Shen 2021-03-01 15:39:18 -05:00
parent c9c8e70afb
commit c975a2ec14
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -97,9 +97,7 @@ impl MutableValue<'_, '_, '_> {
/// the Value event(s) are replaced with a single new event containing the
/// new value.
pub fn set_bytes(&mut self, input: Vec<u8>) {
for _ in 0..self.size {
self.section.remove(self.index);
}
self.section.drain(self.index..self.size);
self.size = 1;
self.section