Skip to content

Commit

Permalink
Calc numTracks outside of the loop
Browse files Browse the repository at this point in the history
Co-authored-by: Swiftb0y <[email protected]>
  • Loading branch information
daschuer and Swiftb0y committed Jan 3, 2025
1 parent c89f06e commit 6ec70aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coreservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ void CoreServices::initialize(QApplication* pApp) {
// Load tracks in args.qlMusicFiles (command line arguments) into player
// 1 and 2:
const QList<QString>& musicFiles = m_cmdlineArgs.getMusicFiles();
for (int i = 0; i < m_pPlayerManager->numberOfDecks() &&
i < musicFiles.count();
++i) {
const int numTracks = std::min(m_pPlayerManager->numberOfDecks(),
static_cast<int>(musicFiles.count()));
for (int i = 0; i < numTracks; ++i) {
if (SoundSourceProxy::isFileNameSupported(musicFiles.at(i))) {
m_pPlayerManager->slotLoadToDeck(musicFiles.at(i), i + 1);
}
Expand Down

0 comments on commit 6ec70aa

Please sign in to comment.