@@ -62,9 +62,9 @@ pub struct WriteBatch<K: StoreKey + Send, const FAMILIES: usize> {
6262 /// The list of new SST files that have been created.
6363 /// Tuple of (sequence number, file).
6464 new_sst_files : Mutex < Vec < ( u32 , File ) > > ,
65- /// Collectors are are current unused, but have memory preallocated.
65+ /// Collectors that are currently unused, but have memory preallocated.
6666 idle_collectors : Mutex < Vec < Collector < K > > > ,
67- /// Collectors are are current unused, but have memory preallocated.
67+ /// Collectors that are currently unused, but have memory preallocated.
6868 idle_thread_local_collectors : Mutex < Vec < Collector < K , THREAD_LOCAL_SIZE_SHIFT > > > ,
6969}
7070
@@ -180,7 +180,6 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
180180 /// Finishes the write batch by returning the new sequence number and the new SST files. This
181181 /// writes all outstanding thread local data to disk.
182182 pub ( crate ) fn finish ( & mut self ) -> Result < FinishResult > {
183- let mut new_sst_files = take ( self . new_sst_files . get_mut ( ) ) ;
184183 let mut new_blob_files = Vec :: new ( ) ;
185184 let shared_error = Mutex :: new ( Ok ( ( ) ) ) ;
186185
@@ -215,6 +214,7 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
215214 } ) ;
216215
217216 // Now we reduce the global collectors in parallel
217+ let mut new_sst_files = take ( self . new_sst_files . get_mut ( ) ) ;
218218 let shared_new_sst_files = Mutex :: new ( & mut new_sst_files) ;
219219
220220 let collectors = replace (
0 commit comments