replace more vector + (issue #2719)
This commit is contained in:
@@ -5,6 +5,7 @@ import ptr::addr_of;
|
||||
import libc::size_t;
|
||||
|
||||
export append;
|
||||
export append_one;
|
||||
export init_op;
|
||||
export is_empty;
|
||||
export is_not_empty;
|
||||
@@ -492,6 +493,13 @@ pure fn append<T: copy>(+lhs: [T]/~, rhs: [const T]/&) -> [T]/~ {
|
||||
ret v;
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pure fn append_one<T>(+lhs: [T]/~, +x: T) -> [T]/~ {
|
||||
let mut v <- lhs;
|
||||
unchecked { push(v, x); }
|
||||
v
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pure fn append_mut<T: copy>(lhs: [mut T]/&, rhs: [const T]/&) -> [mut T]/~ {
|
||||
let mut v = [mut]/~;
|
||||
|
||||
Reference in New Issue
Block a user