Skip to content

Commit

Permalink
Merge pull request #21 from wangleiTT/master
Browse files Browse the repository at this point in the history
Fix rotate bug when array is not your example array "@[@1, @2, @3, @4]".
  • Loading branch information
mxcl authored Jun 9, 2018
2 parents 1201153 + abf3c52 commit 00eb7eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NSArray+rotate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ @implementation NSArray (YOLORotate)
return ^(NSInteger pivot) {
if (pivot < 0)
pivot = (int)self.count + pivot;
return self.skip(pivot).concat(self.snip(pivot));
return self.skip(pivot).concat(self.snip(self.count - pivot));
};
}

Expand Down

0 comments on commit 00eb7eb

Please sign in to comment.