use drain instead

master
Edward Shen 2021-03-01 15:39:18 -05:00
parent c9c8e70afb
commit c975a2ec14
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 1 additions and 3 deletions

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