Skip to content

Commit

Permalink
Fix std::any_of return value not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua committed Nov 18, 2024
1 parent a4f8e03 commit 91754ed
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions native/cocos/audio/android/AudioMixerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,12 @@ bool AudioMixerController::hasPlayingTacks() {
return false;
}

std::any_of(_activeTracks.begin(), _activeTracks.end(), [](Track *track) {
bool result = std::any_of(_activeTracks.begin(), _activeTracks.end(), [](Track *track) {
Track::State state = track->getState();
bool result = false;
if (state == Track::State::IDLE || state == Track::State::PLAYING || state == Track::State::RESUMED) {
result = true;
}
return result;
return state == Track::State::IDLE || state == Track::State::PLAYING || state == Track::State::RESUMED;
});

return false;
return result;
}

} // namespace cc

0 comments on commit 91754ed

Please sign in to comment.