Skip to content

Commit 133266f

Browse files
committed
trans: Eliminated redundant allocations.
1 parent 989f906 commit 133266f

File tree

1 file changed

+10
-14
lines changed
  • src/librustc_trans/trans

1 file changed

+10
-14
lines changed

src/librustc_trans/trans/asm.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,16 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
7777
// no failure occurred preparing operands, no need to cleanup
7878
fcx.pop_custom_cleanup_scope(temp_scope);
7979

80-
let mut constraints =
81-
String::from_str(constraints.iter()
82-
.map(|s| s.get().to_string())
83-
.chain(ext_constraints.into_iter())
84-
.collect::<Vec<String>>()
85-
.connect(",")
86-
.as_slice());
87-
88-
let mut clobbers =
89-
String::from_str(ia.clobbers.iter()
90-
.map(|s| format!("~{{{}}}", s.get()))
91-
.collect::<Vec<String>>()
92-
.connect(",")
93-
.as_slice());
80+
let mut constraints = constraints.iter()
81+
.map(|s| s.get().to_string())
82+
.chain(ext_constraints.into_iter())
83+
.collect::<Vec<String>>()
84+
.connect(",");
85+
86+
let mut clobbers = ia.clobbers.iter()
87+
.map(|s| format!("~{{{}}}", s.get()))
88+
.collect::<Vec<String>>()
89+
.connect(",");
9490
let more_clobbers = get_clobbers();
9591
if !more_clobbers.is_empty() {
9692
if !clobbers.is_empty() {

0 commit comments

Comments
 (0)