diff options
author | Nils Gey <denemo@nilsgey.de> | 2011-02-14 01:48:51 +0100 |
---|---|---|
committer | Nils Gey <denemo@nilsgey.de> | 2011-02-14 01:48:51 +0100 |
commit | 06ec7ac9ba3071808aa534adaf16a884d30bfbba (patch) | |
tree | 1e2b37b6474bfaa9ac19abf91834b4a6d2d12575 | |
parent | 58c5dbe2b706e1b7473b3bc19c2a246bc40b9b37 (diff) |
HUGE performance tweak to selection::MoveToStaffBeginning
-rw-r--r-- | actions/denemo.scm | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/actions/denemo.scm b/actions/denemo.scm index 51e8fa9e..f36baa54 100644 --- a/actions/denemo.scm +++ b/actions/denemo.scm @@ -168,17 +168,12 @@ (define (selection::MoveToStaffBeginning) - (if (d-MarkStatus) - (begin - (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 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. + (define rememberStaff (d-GetStaff)) + (if (d-GoToSelectionStart) + (begin + (d-GoToPosition #f rememberStaff #f #f) + #t) + #f)) ; no selection at all. |