Skip to content
Snippets Groups Projects
Commit 5d8a45e2 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

use empty()

parent 7a116a0a
No related branches found
No related tags found
1 merge request!2741GUI sample builder supports periodic stacks (#20)
......@@ -128,7 +128,7 @@ bool SampleItem::layerIsAmbientOrSubstrate(const LayerItem* layer, bool check_am
// ignore empty stacks
for (int i = components.size() - 1; i >= 0; i--) {
if (auto* stack = dynamic_cast<LayerStackItem*>(components[i]))
if (!stack->uniqueLayerItems().size() || (stack->numberOfPeriods() == 0))
if (stack->uniqueLayerItems().empty() || (stack->numberOfPeriods() == 0))
components.erase(components.begin() + i);
}
ASSERT(components.size());
......
......@@ -224,7 +224,7 @@ std::string Sample::validateAmbientSubstrate() const
auto outer_components = m_outer_stack->components();
for (int i = outer_components.size() - 1; i >= 0; i--)
if (const auto* stack = dynamic_cast<const LayerStack*>(outer_components[i]))
if (!stack->unwrapped().size())
if (stack->unwrapped().empty())
outer_components.erase(outer_components.begin() + i);
std::vector<std::string> errs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment