Project

General

Profile

« Previous | Next » 

Revision e5c441a4

Added by asterite (Ary Borenszweig) almost 6 years ago

Optimize Array#rotate!(n) for n = 1 and n = -1

For the most common cases of rotate! one place to the right or to the
left, instead of doing some reversals of the array we just keep a single
value in a temporary value, use memmove and then put the temporary
value where it should be.