Reduce the number of calls to cdata

This commit is contained in:
Oliver Schneider 2018-04-11 13:31:51 +02:00
parent 04b3ab67d9
commit 748e71e8f4
No known key found for this signature in database
GPG key ID: 1D5CB4FC597C3004

View file

@ -185,8 +185,8 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
if let Some(index) = self.interpret_alloc_index.as_mut() {
return index[idx] as usize;
}
let index = self.cdata().root.interpret_alloc_index;
let index: Vec<u32> = index.decode(self.cdata()).collect();
let cdata = self.cdata();
let index: Vec<u32> = cdata.root.interpret_alloc_index.decode(cdata).collect();
let pos = index[idx];
self.interpret_alloc_index = Some(index);
pos as usize