aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-08-12 13:18:10 -0700
committerRoy Frostig <[email protected]>2010-08-12 13:18:10 -0700
commit6bce296d9fe42a54276198e06389aa8cd85a4262 (patch)
treef02417f8dc3ce58589076820e7415a4b17a1774a /src
parentAdd vec debugging utility to _vec module. (diff)
downloadrust-6bce296d9fe42a54276198e06389aa8cd85a4262.tar.xz
rust-6bce296d9fe42a54276198e06389aa8cd85a4262.zip
Address FIXME in _vec waiting on closed issue #108.
Diffstat (limited to 'src')
-rw-r--r--src/lib/_vec.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs
index bb6b337e..509737d5 100644
--- a/src/lib/_vec.rs
+++ b/src/lib/_vec.rs
@@ -65,12 +65,11 @@ fn print_debug_info[T](vec[T] v) {
// Returns elements from [start..end) from v.
fn slice[T](vec[T] v, int start, int end) -> vec[T] {
- check(0 <= start);
- check(start <= end);
- // FIXME #108: This doesn't work yet.
- //check(end <= int(len[T](v)));
+ check (0 <= start);
+ check (start <= end);
+ check (end <= (len[T](v) as int));
auto result = alloc[T]((end - start) as uint);
- let mutable int i = start;
+ let int i = start;
while (i < end) {
result += vec(v.(i));
i += 1;