Skip to content

Commit

Permalink
Tweak save implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
monarchdodra committed Jan 5, 2014
1 parent 9df6b50 commit 03e2829
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions std/range.d
Expand Up @@ -4333,7 +4333,8 @@ struct Cycle(R)

@property Cycle save()
{
return Cycle(this._original.save, this._index);
//No need to call _original.save, because Cycle never actually modifies _original
return Cycle(_original, _index);
}

private static struct DollarToken {}
Expand Down Expand Up @@ -4400,9 +4401,10 @@ struct Cycle(R)

@property Cycle save()
{
//No need to call _original.save, because Cycle never actually modifies _original
Cycle ret = this;
ret._original = this._original.save;
ret._current = this._current.save;
ret._original = _original;
ret._current = _current.save;
return ret;
}
}
Expand Down

0 comments on commit 03e2829

Please sign in to comment.