File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -106,18 +106,18 @@ static ScriptErrorDesc script_errors[]={
106
106
107
107
static std::string FormatScriptError (ScriptError_t err)
108
108
{
109
- for (unsigned int i= 0 ; i< ARRAYLEN (script_errors); ++i )
110
- if (script_errors[i] .err == err)
111
- return script_errors[i] .name ;
109
+ for (const auto & se : script_errors )
110
+ if (se .err == err)
111
+ return se .name ;
112
112
BOOST_ERROR (" Unknown scripterror enumeration value, update script_errors in script_tests.cpp." );
113
113
return " " ;
114
114
}
115
115
116
- static ScriptError_t ParseScriptError (const std::string & name)
116
+ static ScriptError_t ParseScriptError (const std::string& name)
117
117
{
118
- for (unsigned int i= 0 ; i< ARRAYLEN (script_errors); ++i )
119
- if (script_errors[i] .name == name)
120
- return script_errors[i] .err ;
118
+ for (const auto & se : script_errors )
119
+ if (se .name == name)
120
+ return se .err ;
121
121
BOOST_ERROR (" Unknown scripterror \" " << name << " \" in test description" );
122
122
return SCRIPT_ERR_UNKNOWN_ERROR;
123
123
}
You can’t perform that action at this time.
0 commit comments