ENH: do not consider empty filament

1. Do not consider empty filament when selecting group for ams
2. Function "collect_filaments_in_groups" is frequently called,
optimize memory allocation to speed up.

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iad8c9a257bc2dd832c77e650f8c052fb9d8379a0
(cherry picked from commit 21379e13366fd70f0042e85dcf8ee220185c782d)
This commit is contained in:
xun.zhang
2024-10-16 10:54:49 +08:00
committed by Noisyfox
parent 99f0e35069
commit 950da4ecfd
2 changed files with 23 additions and 21 deletions

View File

@@ -195,8 +195,10 @@ namespace Slic3r
for (size_t idx = 0; idx < ams_filament_colors_str.size(); ++idx) {
std::vector<Color> tmp;
for (auto& item : ams_filament_colors_str[idx])
tmp.emplace_back(Color(item));
for (auto& item : ams_filament_colors_str[idx]) {
if (!item.empty())
tmp.emplace_back(Color(item));
}
ams_filament_colors[idx] = std::move(tmp);
}