mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
Replace pointless looping by 'if'
The for loop was only to test if *some* track was selected, and its body only needs to be executed once. Note that an empty IteratorRange is false and one with something in it is true.
This commit is contained in:
parent
15a3ea7763
commit
e20a98588c
@ -344,8 +344,7 @@ void ContrastDialog::OnGetForeground(wxCommandEvent & /*event*/)
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
|
||||
for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) {
|
||||
(void)t;// Compiler food;
|
||||
if( p->GetTracks()->Selected< const WaveTrack >() ) {
|
||||
mForegroundStartT->SetValue(p->mViewInfo.selectedRegion.t0());
|
||||
mForegroundEndT->SetValue(p->mViewInfo.selectedRegion.t1());
|
||||
}
|
||||
@ -360,8 +359,7 @@ void ContrastDialog::OnGetBackground(wxCommandEvent & /*event*/)
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
|
||||
for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) {
|
||||
(void)t;// Compiler food;
|
||||
if( p->GetTracks()->Selected< const WaveTrack >() ) {
|
||||
mBackgroundStartT->SetValue(p->mViewInfo.selectedRegion.t0());
|
||||
mBackgroundEndT->SetValue(p->mViewInfo.selectedRegion.t1());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user