Skip to content

Commit f9860cd

Browse files
committed
Optimize functions ResetFrom
The loop can terminate as soon as the parameter name was found. Signed-off-by: Stefan Weil <[email protected]>
1 parent 41da5af commit f9860cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ccutil/params.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: params.h
33
* Description: Class definitions of the *_VAR classes for tunable constants.
44
* Author: Ray Smith
5-
* Created: Fri Feb 22 11:26:25 GMT 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -157,6 +156,7 @@ class IntParam : public Param {
157156
// printf("overriding param %s=%d by =%d\n", name_, value_,
158157
// *vec->int_params[i]);
159158
value_ = *vec->int_params[i];
159+
break;
160160
}
161161
}
162162
}
@@ -189,6 +189,7 @@ class BoolParam : public Param {
189189
// printf("overriding param %s=%s by =%s\n", name_, value_ ? "true" :
190190
// "false", *vec->bool_params[i] ? "true" : "false");
191191
value_ = *vec->bool_params[i];
192+
break;
192193
}
193194
}
194195
}
@@ -225,6 +226,7 @@ class StringParam : public Param {
225226
// printf("overriding param %s=%s by =%s\n", name_, value_,
226227
// vec->string_params[i]->c_str());
227228
value_ = *vec->string_params[i];
229+
break;
228230
}
229231
}
230232
}
@@ -257,6 +259,7 @@ class DoubleParam : public Param {
257259
// printf("overriding param %s=%f by =%f\n", name_, value_,
258260
// *vec->double_params[i]);
259261
value_ = *vec->double_params[i];
262+
break;
260263
}
261264
}
262265
}

0 commit comments

Comments
 (0)