Skip to content

Commit 19aae8e

Browse files
committed
Reuse iterator to avoid unnecessary creation.
1 parent 2655c89 commit 19aae8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_metadata/decoder.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1449,8 +1449,9 @@ pub fn get_dylib_dependency_formats(cdata: Cmd)
14491449
debug!("found dylib deps: {}", formats.as_str());
14501450
for spec in formats.as_str().split(',') {
14511451
if spec.is_empty() { continue }
1452-
let cnum = spec.split(':').nth(0).unwrap();
1453-
let link = spec.split(':').nth(1).unwrap();
1452+
let mut split = spec.split(':');
1453+
let cnum = split.next().unwrap();
1454+
let link = split.next().unwrap();
14541455
let cnum: ast::CrateNum = cnum.parse().unwrap();
14551456
let cnum = cdata.cnum_map.borrow()[cnum];
14561457
result.push((cnum, if link == "d" {

0 commit comments

Comments
 (0)