Skip to content

Commit

Permalink
create num_items outsit the loop.
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Holthuis <[email protected]>
  • Loading branch information
daschuer and Holzhaus authored Jan 27, 2025
1 parent f3211d5 commit 419f78a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rendergraph/common/rendergraph/uniformset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
using namespace rendergraph;

UniformSet::UniformSet(std::initializer_list<Uniform> list, const std::vector<QString>& names) {
for (std::size_t i = 0; i < list.size() && i < names.size(); ++i) {
const auto num_items = std::min(list.size(), names.size());
for (std::size_t i = 0; i < num_items; ++i) {
add(Uniform{list.begin()[i].m_type, names[i]});
}
}
Expand Down

0 comments on commit 419f78a

Please sign in to comment.