diff options
| author | Kang Seonghoon <public+git@mearie.org> | 2014-11-30 18:52:44 +0900 |
|---|---|---|
| committer | Kang Seonghoon <public+git@mearie.org> | 2014-11-30 18:52:44 +0900 |
| commit | 133266f01ca6bd1a75cdb0887c3c9f6ea500795f (patch) | |
| tree | e3cd72e1c8fa16c914056dc55e99f594af4e32e9 | |
| parent | 989f906af31d8a1d25eb3657896d2f3550d62fa2 (diff) | |
| download | rust-133266f01ca6bd1a75cdb0887c3c9f6ea500795f.tar.gz rust-133266f01ca6bd1a75cdb0887c3c9f6ea500795f.zip | |
trans: Eliminated redundant allocations.
| -rw-r--r-- | src/librustc_trans/trans/asm.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/librustc_trans/trans/asm.rs b/src/librustc_trans/trans/asm.rs index 58bb42f3d67..77102d2db39 100644 --- a/src/librustc_trans/trans/asm.rs +++ b/src/librustc_trans/trans/asm.rs @@ -77,20 +77,16 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm) // no failure occurred preparing operands, no need to cleanup fcx.pop_custom_cleanup_scope(temp_scope); - let mut constraints = - String::from_str(constraints.iter() - .map(|s| s.get().to_string()) - .chain(ext_constraints.into_iter()) - .collect::<Vec<String>>() - .connect(",") - .as_slice()); - - let mut clobbers = - String::from_str(ia.clobbers.iter() - .map(|s| format!("~{{{}}}", s.get())) - .collect::<Vec<String>>() - .connect(",") - .as_slice()); + let mut constraints = constraints.iter() + .map(|s| s.get().to_string()) + .chain(ext_constraints.into_iter()) + .collect::<Vec<String>>() + .connect(","); + + let mut clobbers = ia.clobbers.iter() + .map(|s| format!("~{{{}}}", s.get())) + .collect::<Vec<String>>() + .connect(","); let more_clobbers = get_clobbers(); if !more_clobbers.is_empty() { if !clobbers.is_empty() { |
