Skip to content

Commit

Permalink
Changed static slicing to relative slicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Cousens committed Sep 5, 2012
1 parent cf18f28 commit 7492947
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/range.d
Expand Up @@ -4375,7 +4375,7 @@ public:
}
body
{
auto s = typeof(this)(this._state, lower);
auto s = typeof(this)(this._state, this._n + lower);
return takeExactly(s, upper - lower);
}

Expand Down Expand Up @@ -4435,9 +4435,9 @@ unittest
assert(equal(odds[0 .. 5], take(odds, 5)));
assert(equal(odds[3 .. 7], take(drop(odds, 3), 4)));

// relative slicing test, testing slicing is agnostic of state
odds = drop(odds, 5);
assert(equal(odds[5 .. 9], take(odds, 4)));
// relative slicing test, testing slicing is NOT agnostic of state
auto odds_less5 = drop(odds, 5);
assert(equal(odds_less5[0 .. 10], odds[5 .. 15]));
}

/**
Expand Down

0 comments on commit 7492947

Please sign in to comment.