From 58c5dbe2b706e1b7473b3bc19c2a246bc40b9b37 Mon Sep 17 00:00:00 2001 From: Nils Gey Date: Mon, 14 Feb 2011 01:41:39 +0100 Subject: Small performance tweak to selection::MoveToStaffBeginning --- actions/denemo.scm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/actions/denemo.scm b/actions/denemo.scm index ee041bc2..51e8fa9e 100644 --- a/actions/denemo.scm +++ b/actions/denemo.scm @@ -168,20 +168,17 @@ (define (selection::MoveToStaffBeginning) -(d-PushPosition) - (if (d-GoToSelectionStart) ; Test if there is a selection at all + (if (d-MarkStatus) (begin - (d-PopPosition); return to the initial position to go to the correct staff (d-PushPosition); save it again in case that there is no selection in this staff. (d-MoveToBeginning) (let loop () ; Real work begins here. Loop through until you found it or end of staff. (if (d-IsInSelection) - #t ; found the first note - (if (d-NextObject) (loop) ; prevent endless loop if reaching the end of a staff without selection present - (begin (d-PopPosition) #f )))) ; if end of staff and no selection return to initial position and return #f - ) - (begin (d-PopPosition) #f ) ; no selection at all. - )) ; fi GoToSelectionStart + #t ; found a selection. stop. + (if (d-NextObject) + (loop) ; prevent endless loop if reaching the end of a staff without selection present + (begin (d-PopPosition) #f )))) ) ; if end of staff and no selection return to initial position and return #f + #f)) ; no selection at all. -- cgit v1.2.3