Skip to content

Commit

Permalink
Reuse iterator to avoid unnecessary creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Aug 24, 2016
1 parent 2655c89 commit 19aae8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_metadata/decoder.rs
Expand Up @@ -1449,8 +1449,9 @@ pub fn get_dylib_dependency_formats(cdata: Cmd)
debug!("found dylib deps: {}", formats.as_str());
for spec in formats.as_str().split(',') {
if spec.is_empty() { continue }
let cnum = spec.split(':').nth(0).unwrap();
let link = spec.split(':').nth(1).unwrap();
let mut split = spec.split(':');
let cnum = split.next().unwrap();
let link = split.next().unwrap();
let cnum: ast::CrateNum = cnum.parse().unwrap();
let cnum = cdata.cnum_map.borrow()[cnum];
result.push((cnum, if link == "d" {
Expand Down

0 comments on commit 19aae8e

Please sign in to comment.