From 672b4df7c13b0e0a9d42b38bd8fa9c2510989f57 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 6 Apr 2016 13:36:44 -0700 Subject: [PATCH] get rid of magic number --- libraries/script-engine/src/ScriptEngine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index bcd509ff53..67e32a2ad8 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -1094,8 +1094,9 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co testConstructorType = "empty"; } QString testConstructorValue = testConstructor.toString(); - if (testConstructorValue.size() > 80) { - testConstructorValue = testConstructorValue.mid(0, 80) + "..."; + const int maxTestConstructorValueSize = 80; + if (testConstructorValue.size() > maxTestConstructorValueSize) { + testConstructorValue = testConstructorValue.mid(0, maxTestConstructorValueSize) + "..."; } qCDebug(scriptengine) << "Error -- ScriptEngine::loadEntityScript() entity:" << entityID << "failed to load entity script -- expected a function, got " + testConstructorType