We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9029416 commit 48c2c9bCopy full SHA for 48c2c9b
src/lib/vec.rs
@@ -18,7 +18,7 @@ fn reserve<@T>(&v: [mutable? T], n: uint) {
18
rustrt::vec_reserve_shared(v, n);
19
}
20
21
-fn len<T>(v: [mutable? T]) -> uint { ret rusti::vec_len(v); }
+pure fn len<T>(v: [mutable? T]) -> uint { unchecked { rusti::vec_len(v) } }
22
23
type init_op<T> = fn(uint) -> T;
24
@@ -271,9 +271,7 @@ fn position_pred<T>(f: fn(T) -> bool, v: [T]) -> option::t<uint> {
271
272
273
pure fn same_length<T, U>(xs: [T], ys: [U]) -> bool {
274
- let xlen = unchecked{ vec::len(xs) };
275
- let ylen = unchecked{ vec::len(ys) };
276
- xlen == ylen
+ vec::len(xs) == vec::len(ys)
277
278
279
// FIXME: if issue #586 gets implemented, could have a postcondition
0 commit comments