Skip to content

Commit

Permalink
Reduce the number of calls to cdata
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Apr 14, 2018
1 parent 04b3ab6 commit 748e71e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_metadata/decoder.rs
Expand Up @@ -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
Expand Down

0 comments on commit 748e71e

Please sign in to comment.