History

show that all data can be passed for processing in threads

Sebastian Thiel committed 6 years ago

Commit a95ce9c1 parent 1d4879a1 file · +17 −2Browse files

Unified · Split

git-odb/src/pack/index/write/mod.rs+17−2
@@ -24,7 +24,7 @@ impl pack::index::File { · 23 unmodified lines
2424 out: impl io::Write,
2525 ) -> Result<Outcome, Error>
2626 where
27− F: for<'r> Fn(u64, &'r mut Vec<u8>) -> Option<(pack::data::Header, u64)>,
27+ F: for<'r> Fn(u64, &'r mut Vec<u8>) -> Option<(pack::data::Header, u64)> + Send + Sync,
2828 {
2929 use io::Write;
3030
@@ -120,7 +120,9 @@ impl pack::index::File { · 89 unmodified lines
120120 },
121121 thread_limit,
122122 |_| (),
123− |_base_pack_offsets, _state| Vec::new(),
123+ |base_pack_offsets, state| {
124+ apply_deltas(base_pack_offsets, state, &index_entries, &_cache_by_offset, &mode)
125+ },
124126 Reducer::new(num_objects),
125127 )?;
126128 items.sort_by_key(|e| e.1);
@@ -151,3 +153,16 @@ impl pack::index::File { · 24 unmodified lines
151153 })
152154 }
153155 }
156+
157+fn apply_deltas<F>(
158+ _base_entries: Vec<&Entry>,
159+ _state: &mut (),
160+ _entries: &[Entry],
161+ _caches: &parking_lot::Mutex<BTreeMap<u64, CacheEntry>>,
162+ _mode: &Mode<F>,
163+) -> Vec<(u64, owned::Id)>
164+where
165+ F: for<'r> Fn(u64, &'r mut Vec<u8>) -> Option<(pack::data::Header, u64)> + Send + Sync,
166+{
167+ Vec::new()
168+}