From d38b3f771484bd9d2502e9d20c48498d61f7b59e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 24 Aug 2018 15:53:58 -0500 Subject: [PATCH] Address @smharper comments --- src/source.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/source.cpp b/src/source.cpp index c3869fcf4..70240b10d 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -304,12 +304,11 @@ Bank sample_external_source() total_strength += s.strength(); // Sample from among multiple source distributions - auto n_source = external_sources.size(); int i = 0; - if (n_source > 1) { + if (external_sources.size() > 1) { double xi = prn()*total_strength; double c = 0.0; - for (i = 0; i < external_sources.size(); ++i) { + for (; i < external_sources.size(); ++i) { c += external_sources[i].strength(); if (xi < c) break; }