Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0397-Remove-unnecessary-1-for-pretty-move-half....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0397-Remove-unnecessary-1-for-pretty-move-half.patch of Package erlang
From 1315cfb7ade016be50f9525921b9c85559312160 Mon Sep 17 00:00:00 2001 From: zeek0x <0h23k1.n40k1@gmail.com> Date: Mon, 21 Feb 2022 02:19:05 +0900 Subject: [PATCH 1/2] Remove unnecessary '+ 1' for pretty move half When move half run, - R2f - Before - Rear: 2n+1, Front: 0 -> Rear: n+1, Front: n - Rear: 2n, Front: 0 -> Rear: n+1, Front: n-1 - After - Rear: 2n+1, Front: 0 -> Rear: n, Front: n+1 - Rear: 2n, Front: 0 -> Rear: n, Front: n It is same for F2r if switch the Rear and Front. --- lib/stdlib/src/queue.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/stdlib/src/queue.erl b/lib/stdlib/src/queue.erl index 67ea0f8be4..1ff59af782 100644 --- a/lib/stdlib/src/queue.erl +++ b/lib/stdlib/src/queue.erl @@ -706,7 +706,7 @@ r2f([_]=R) -> r2f([X,Y]) -> {[X],[Y]}; r2f(List) -> - {FF,RR} = lists:split(length(List) div 2 + 1, List), + {FF,RR} = lists:split(length(List) div 2, List), {FF,lists:reverse(RR, [])}. %% Move half of elements from F to R, if there are enough @@ -717,5 +717,5 @@ f2r([_]=F) -> f2r([X,Y]) -> {[Y],[X]}; f2r(List) -> - {FF,RR} = lists:split(length(List) div 2 + 1, List), + {FF,RR} = lists:split(length(List) div 2, List), {lists:reverse(RR, []),FF}. -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor