MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / accept

Method accept

dstack-mr/src/tdvf.rs:512–534  ·  view source on GitHub ↗
(&mut self, start: u64, end: u64)

Source from the content-addressed store, hash-verified

510 }
511
512 fn accept(&mut self, start: u64, end: u64) {
513 if start >= end {
514 return;
515 }
516
517 let mut new_ranges = Vec::new();
518
519 for &(is_accepted, range_start, range_end) in &self.ranges {
520 if is_accepted || range_end <= start || range_start >= end {
521 new_ranges.push((is_accepted, range_start, range_end));
522 } else {
523 if range_start < start {
524 new_ranges.push((false, range_start, start));
525 }
526 if range_end > end {
527 new_ranges.push((false, end, range_end));
528 }
529 }
530 }
531 new_ranges.push((true, start, end));
532 new_ranges.sort_by_key(|&(_, start, _)| start);
533 self.ranges = new_ranges;
534 }
535}

Callers 2

measure_td_hobMethod · 0.45

Calls

no outgoing calls

Tested by 1