fn insert(&mut self, batch: Self::Batch) {
        assert!(batch.lower() != batch.upper());

        self.cursor_storage.borrow_mut().clear();

        // Ignore empty batches.
        // Note: we may want to use empty batches to artificially force compaction.
        if batch.is_empty() {
            return;
        }

        self.dirty = true;
        self.lower = self.lower.meet(batch.lower());
        self.upper = self.upper.join(batch.upper());

        // Leonid: we do not require batch bounds to grow monotonically.
        //assert_eq!(batch.lower(), &self.upper);

        let index = batch.len().next_power_of_two();
        self.introduce_batch(Some(batch), index.trailing_zeros() as usize);

        // If more than one batch remains reschedule ourself.
        if !self.reduced() {
            if let Some(activator) = &self.activator {
                activator.activate();
            }
        }
    }
// Ideally, this method acts as insertion of `batch`, even if we are not yet
// able to begin merging the batch. This means it is a good time to perform
// amortized work proportional to the size of batch.
Ideally, this method acts as insertion of `batch`, even if we are not yet
able to begin merging the batch. This means it is a good time to perform
amortized work proportional to the size of batch.
Ideally this method acts as insertion of ` batch ` even if we are not yet able to begin merging the batch . This means it is a good time to perform amortized work proportional to the size of batch .
fn insert(&mut self, batch: Self::Batch) {
        assert!(batch.lower() != batch.upper());
        self.cursor_storage.borrow_mut().clear();
        // Ignore empty batches.
        // Note: we may want to use empty batches to artificially force compaction.
        if batch.is_empty() {
            return;
        }
        self.dirty = true;
        self.lower = self.lower.meet(batch.lower());
        self.upper = self.upper.join(batch.upper());
        // Leonid: we do not require batch bounds to grow monotonically.
        //assert_eq!(batch.lower(), &self.upper);
        let index = batch.len().next_power_of_two();
        self.introduce_batch(Some(batch), index.trailing_zeros() as usize);
        // If more than one batch remains reschedule ourself.
        if !self.reduced() {
            if let Some(activator) = &self.activator {
                activator.activate();
            }
        }
    }
fn insert ( & mut self , batch : Self :: Batch ) { assert ! ( batch lower ( ) batch upper ( ) ) ; self . cursor_storage . borrow_mut ( ) . clear ( ) ; // Ignore empty batches. // Note: we may want to use empty batches to artificially force compaction. if batch . is_empty ( ) { return ; } self . dirty = true ; self . lower = self . lower . meet ( batch . lower ( ) ) ; self . upper = self . upper . join ( batch . upper ( ) ) ; // Leonid: we do not require batch bounds to grow monotonically. //assert_eq!(batch.lower(), &self.upper); let index = batch . len ( ) . next_power_of_two ( ) ; self . introduce_batch ( Some ( batch ) , index . trailing_zeros ( ) as usize ) ; // If more than one batch remains reschedule ourself. if ! self . reduced ( ) { if let Some ( activator ) = & self . activator { activator . activate ( ) ; } } }
Ideally, this method acts as insertion of `batch`, even if we are not yet
able to begin merging the batch.
Ideally this method acts as insertion of ` batch ` even if we are not yet able to begin merging the batch .
&mut self
batch
Self::Batch