History

get rid of magic number

Seth Alves committed 10 years ago

Commit 672b4df1 parent 21c2db71 file · +3 −2Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+3−2
@@ -1094,8 +1094,9 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 1093 unmodified lines
10941094 testConstructorType = "empty";
10951095 }
10961096 QString testConstructorValue = testConstructor.toString();
1097− if (testConstructorValue.size() > 80) {
1098− testConstructorValue = testConstructorValue.mid(0, 80) + "...";
1097+ const int maxTestConstructorValueSize = 80;
1098+ if (testConstructorValue.size() > maxTestConstructorValueSize) {
1099+ testConstructorValue = testConstructorValue.mid(0, maxTestConstructorValueSize) + "...";
10991100 }
11001101 qCDebug(scriptengine) << "Error -- ScriptEngine::loadEntityScript() entity:" << entityID
11011102 << "failed to load entity script -- expected a function, got " + testConstructorType