remote_chunk_reader.rs: use Arc for cache_hint to make clone faster

This commit is contained in:
Dietmar Maurer 2020-09-22 09:51:19 +02:00
parent 796480a38b
commit 7ecfde8150

View File

@ -15,7 +15,7 @@ pub struct RemoteChunkReader {
client: Arc<BackupReader>,
crypt_config: Option<Arc<CryptConfig>>,
crypt_mode: CryptMode,
cache_hint: HashMap<[u8; 32], usize>,
cache_hint: Arc<HashMap<[u8; 32], usize>>,
cache: Arc<Mutex<HashMap<[u8; 32], Vec<u8>>>>,
}
@ -33,7 +33,7 @@ impl RemoteChunkReader {
client,
crypt_config,
crypt_mode,
cache_hint,
cache_hint: Arc::new(cache_hint),
cache: Arc::new(Mutex::new(HashMap::new())),
}
}