From 861f1323269acf82059c3c855155ea1aff0db71a Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 29 Oct 2020 01:56:46 -0400 Subject: handle the empty write properly --- src/wal.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/wal.rs b/src/wal.rs index 7975f38..119fdf3 100644 --- a/src/wal.rs +++ b/src/wal.rs @@ -255,6 +255,9 @@ impl WALFilePool { &'a mut self, writes: Vec<(WALPos, WALBytes)>, ) -> Vec> + 'a>>> { + if writes.is_empty() { + return Vec::new() + } let file_size = self.file_size; let file_nbit = self.file_nbit; let meta: Vec<(u64, u64)> = writes -- cgit v1.2.3-70-g09d2