diff options
author | Ary Borenszweig <asterite@gmail.com> | 2019-11-29 17:59:47 -0300 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-29 13:12:42 +0900 |
commit | e5c441a4a2885da61df9894ac17b69cb3c5811f2 (patch) | |
tree | 1c997ff3749cde5d8a1d73d799a51e0ad91ae3b3 /test/io | |
parent | a0d1fd16d156d289d5ea46327a98517a9b31f860 (diff) | |
download | ruby-e5c441a4a2885da61df9894ac17b69cb3c5811f2.tar.gz |
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.
Diffstat (limited to 'test/io')
0 files changed, 0 insertions, 0 deletions