Skip to content
Snippets Groups Projects
Commit 55a725c0 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

Fixed Take method of SequenceList.

parent ec6bde94
No related branches found
No related tags found
No related merge requests found
......@@ -207,8 +207,7 @@ SequenceList SequenceList::Take(int n) const
{
this->CheckValidity();
if (n<0) {
return SequenceList(impl_->Slice(impl_->GetCount()+n-1,
impl_->GetCount()));
return SequenceList(impl_->Slice(impl_->GetCount()+n, -n));
} else {
return SequenceList(impl_->Slice(0, n));
}
......@@ -224,8 +223,7 @@ ConstSequenceList ConstSequenceList::Take(int n) const
{
this->CheckValidity();
if (n<0) {
return ConstSequenceList(impl_->Slice(impl_->GetCount()+n-1,
impl_->GetCount()));
return ConstSequenceList(impl_->Slice(impl_->GetCount()+n, -n));
} else {
return ConstSequenceList(impl_->Slice(0, n));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment