From 03793d5e4dba32bcce433f32c585dc916e7c4147 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 18 Mar 2021 17:23:25 -0400 Subject: [PATCH] simplify --- src/modify.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/modify.cpp b/src/modify.cpp index 9cb90fc36f..80cf2667fe 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1099,11 +1099,9 @@ int Modify::find_fix(const std::string &id) int Modify::find_fix_by_style(const char *style) { - int ifix; - for (ifix = 0; ifix < nfix; ifix++) - if (utils::strmatch(fix[ifix]->style,style)) break; - if (ifix == nfix) return -1; - return ifix; + for (int ifix = 0; ifix < nfix; ifix++) + if (utils::strmatch(fix[ifix]->style,style)) return ifix; + return -1; } /* ---------------------------------------------------------------------- @@ -1359,11 +1357,9 @@ int Modify::find_compute(const std::string &id) int Modify::find_compute_by_style(const char *style) { - int icompute; - for (icompute = 0; icompute < ncompute; icompute++) - if (utils::strmatch(compute[icompute]->style,style)) break; - if (icompute == ncompute) return -1; - return icompute; + for (int icompute = 0; icompute < ncompute; icompute++) + if (utils::strmatch(compute[icompute]->style,style)) return icompute; + return -1; } /* ----------------------------------------------------------------------