Skip to content

Commit

Permalink
Fix rotate bug when array is not your example array "@[@1, @2, @3, @4]".
Browse files Browse the repository at this point in the history
  • Loading branch information
王磊 committed Jun 1, 2018
1 parent 1201153 commit abf3c52
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 abf3c52

Please sign in to comment.