Commit 1d353d3 Tim
committed
1 parent 820c56c commit 1d353d3 Copy full SHA for 1d353d3
File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -3412,28 +3412,30 @@ MusEGui::ListEdit* MusE::findOpenListEditor(MusECore::PartList* pl) {
3412
3412
&& QGuiApplication::keyboardModifiers () & Qt::AltModifier)
3413
3413
return nullptr ;
3414
3414
3415
+ const unsigned int pl_sz = pl->size ();
3416
+ if (pl_sz == 0 )
3417
+ return nullptr ;
3418
+
3415
3419
for (const auto & d : findChildren<QDockWidget*>()) {
3416
3420
if (strcmp (d->widget ()->metaObject ()->className (), " MusEGui::ListEdit" ) != 0 )
3417
3421
continue ;
3418
3422
3419
3423
MusEGui::ListEdit* le = static_cast <MusEGui::ListEdit*>(d->widget ());
3420
3424
const MusECore::PartList* pl_tmp = le->parts ();
3421
3425
3422
- bool found = false ;
3423
- for (MusECore::ciPart ip_tmp = pl_tmp-> cbegin (); ip_tmp != pl_tmp ->cend (); ++ip_tmp )
3426
+ MusECore::ciPart ip = pl-> cbegin () ;
3427
+ for (; ip != pl ->cend (); ++ip )
3424
3428
{
3425
- for (MusECore::ciPart ip = pl->cbegin (); ip != pl->cend (); ++ip)
3429
+ MusECore::ciPart ip_tmp = pl_tmp->cbegin ();
3430
+ for (; ip_tmp != pl_tmp->cend (); ++ip_tmp)
3426
3431
{
3427
- if (ip->second ->uuid () == ip_tmp->second ->uuid ())
3428
- {
3429
- found = true ;
3432
+ if (ip_tmp->second ->uuid () == ip->second ->uuid ())
3430
3433
break ;
3431
- }
3432
3434
}
3433
- if (found )
3435
+ if (ip_tmp == pl_tmp-> cend () )
3434
3436
break ;
3435
3437
}
3436
- if (!found )
3438
+ if (ip != pl-> cend () )
3437
3439
continue ;
3438
3440
3439
3441
if (!d->isVisible ())
You can’t perform that action at this time.
0 commit comments