From f9860cda41fea6edce542c15dc17688efb0e5451 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 24 Mar 2019 21:21:23 +0100 Subject: [PATCH] Optimize functions ResetFrom The loop can terminate as soon as the parameter name was found. Signed-off-by: Stefan Weil --- src/ccutil/params.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ccutil/params.h b/src/ccutil/params.h index ee5f0a97..4f90b9dc 100644 --- a/src/ccutil/params.h +++ b/src/ccutil/params.h @@ -2,7 +2,6 @@ * File: params.h * Description: Class definitions of the *_VAR classes for tunable constants. * Author: Ray Smith - * Created: Fri Feb 22 11:26:25 GMT 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -157,6 +156,7 @@ class IntParam : public Param { // printf("overriding param %s=%d by =%d\n", name_, value_, // *vec->int_params[i]); value_ = *vec->int_params[i]; + break; } } } @@ -189,6 +189,7 @@ class BoolParam : public Param { // printf("overriding param %s=%s by =%s\n", name_, value_ ? "true" : // "false", *vec->bool_params[i] ? "true" : "false"); value_ = *vec->bool_params[i]; + break; } } } @@ -225,6 +226,7 @@ class StringParam : public Param { // printf("overriding param %s=%s by =%s\n", name_, value_, // vec->string_params[i]->c_str()); value_ = *vec->string_params[i]; + break; } } } @@ -257,6 +259,7 @@ class DoubleParam : public Param { // printf("overriding param %s=%f by =%f\n", name_, value_, // *vec->double_params[i]); value_ = *vec->double_params[i]; + break; } } }