useStlAlgorithm: ranges algorithms + justifica returnDanglingLifetime
This commit is contained in:
1 parent
d7db02bafd
commit
822bed0748
5 files changed
+15
-25
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -41,10 +42,7 @@ namespace {
|
||||
if (!yaml.contains("animations") || !yaml["animations"].contains("swing")) { return; }
|
||||
const auto& sw = yaml["animations"]["swing"];
|
||||
if (!sw.contains("active_frames")) { return; }
|
||||
for (const auto& f : sw["active_frames"]) {
|
||||
// cppcheck-suppress useStlAlgorithm
|
||||
active_out.push_back(f.get_value<int>());
|
||||
}
|
||||
std::ranges::transform(sw["active_frames"], std::back_inserter(active_out), [](const fkyaml::node& f) { return f.template get_value<int>(); });
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in new issue
Block a user