From 5d441251fc9b924ff0038290e63ffb34d5d9a560 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 30 Sep 2022 13:56:01 -0500 Subject: [PATCH] Apply @pshriwise suggestions from code review Co-authored-by: Patrick Shriwise --- src/source.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/source.cpp b/src/source.cpp index e443c49e6..fc50115cd 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -217,19 +217,14 @@ SourceSite IndependentSource::sample(uint64_t* seed) const if (domain_type_ == DomainType::MATERIAL) { auto mat_index = p.material(); if (mat_index != MATERIAL_VOID) { - if (contains(domain_ids_, model::materials[mat_index]->id())) { - found = true; - } + found = contains(domain_ids_, model::materials[mat_index]->id()); } } else { for (const auto& coord : p.coord()) { auto id = (domain_type_ == DomainType::CELL) ? model::cells[coord.cell]->id_ : model::universes[coord.universe]->id_; - if (contains(domain_ids_, id)) { - found = true; - break; - } + if (found = contains(domain_ids_, id)) break; } } }