Skip to content

Commit 5ffec3a

Browse files
committed
---
yaml --- r: 5517 b: refs/heads/master c: 48c2c9b h: refs/heads/master i: 5515: 58c6e07 v: v3
1 parent 2d944af commit 5ffec3a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9029416e287e663bd6a1f48727509872669853c0
2+
refs/heads/master: 48c2c9b3a7da174d58219f2c2e0cc43926280f35

trunk/src/lib/vec.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn reserve<@T>(&v: [mutable? T], n: uint) {
1818
rustrt::vec_reserve_shared(v, n);
1919
}
2020

21-
fn len<T>(v: [mutable? T]) -> uint { ret rusti::vec_len(v); }
21+
pure fn len<T>(v: [mutable? T]) -> uint { unchecked { rusti::vec_len(v) } }
2222

2323
type init_op<T> = fn(uint) -> T;
2424

@@ -271,9 +271,7 @@ fn position_pred<T>(f: fn(T) -> bool, v: [T]) -> option::t<uint> {
271271
}
272272

273273
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
274+
vec::len(xs) == vec::len(ys)
277275
}
278276

279277
// FIXME: if issue #586 gets implemented, could have a postcondition

0 commit comments

Comments
 (0)