SonarCloudにBugだと言われているオブジェクトスライスに対策する #1576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR の目的
カテゴリ
PR の背景
前回の対策(#1554)がうまくいかなかったので再考しました。
PR のメリット
SonarCloudのBugsレベル警告が1つ解消します。
PR のデメリット (トレードオフとかあれば)
とくにありません。
仕様・動作説明
オブジェクトスライスが発生している、というのに対策します。
前回 std::move しましたが、static_castするように変更します。
PR の影響範囲
テスト内容
修正内容は動作に影響をあたえません。
このPRをマージした状態のブランチでSonarScanして、Bugsレベル警告が解消することを確認しました。
https://github.com/berryzplus/sakura/runs/2051423177
関連 issue, PR
#1554
#1504
参考資料