lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid using Skyline_pair::insert. (issue 554000043 by address@hidden


From: hanwenn
Subject: Re: Avoid using Skyline_pair::insert. (issue 554000043 by address@hidden)
Date: Mon, 04 May 2020 02:14:46 -0700

Reviewers: hahnjo,


https://codereview.appspot.com/554000043/diff/549990043/lily/align-interface.cc
File lily/align-interface.cc (right):

https://codereview.appspot.com/554000043/diff/549990043/lily/align-interface.cc#newcode90
lily/align-interface.cc:90: Real offset = g->relative_coordinate
(other_common, other_axis (a));
On 2020/05/04 08:12:32, hahnjo wrote:
> Is this code intentionally moving into if (skys) ?

yes. Moving around empty skylines is a nop.

Description:
Avoid using Skyline_pair::insert.

Skyline::insert(Box) creates a skyline and merges it. In this case,
the boxes are non-overlapping, so it is trivial to create a skyline
out of them.

Remove Skyline::insert(). Using it repeatedly leads to a quadratic
complexity, so it's best avoided.

Timing benchmarks are neutral

Please review this at https://codereview.appspot.com/554000043/

Affected files (+43, -71 lines):
  M lily/align-interface.cc
  M lily/include/skyline-pair.hh
  M lily/skyline.cc
  M lily/skyline-pair.cc





reply via email to

[Prev in Thread] Current Thread [Next in Thread]