diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-08-01 03:58:13 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-02 05:43:04 +0200 |
commit | ea9ff71725113b8dbb159917c57aa536bba0cb53 (patch) | |
tree | 512cce0fea5eb511aa7803bc67f741815885bfcb /src/audio_core/renderer/behavior | |
parent | Merge pull request #8752 from vonchenplus/rectangle_texture (diff) | |
download | yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.gz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.bz2 yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.lz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.xz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.zst yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.zip |
Diffstat (limited to 'src/audio_core/renderer/behavior')
-rw-r--r-- | src/audio_core/renderer/behavior/behavior_info.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/behavior/behavior_info.cpp b/src/audio_core/renderer/behavior/behavior_info.cpp index c5d4d66d8..92140aaea 100644 --- a/src/audio_core/renderer/behavior/behavior_info.cpp +++ b/src/audio_core/renderer/behavior/behavior_info.cpp @@ -43,13 +43,15 @@ void BehaviorInfo::AppendError(ErrorInfo& error) { } void BehaviorInfo::CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) { - auto error_count_{std::min(error_count, MaxErrors)}; - std::memset(out_errors.data(), 0, MaxErrors * sizeof(ErrorInfo)); - - for (size_t i = 0; i < error_count_; i++) { - out_errors[i] = errors[i]; + out_count = std::min(error_count, MaxErrors); + + for (size_t i = 0; i < MaxErrors; i++) { + if (i < out_count) { + out_errors[i] = errors[i]; + } else { + out_errors[i] = {}; + } } - out_count = error_count_; } void BehaviorInfo::UpdateFlags(const Flags flags_) { |