[apps/code] variable_box_controller: avoid unused variable warning when DEBUG=0

This commit is contained in:
Émilie Feral
2020-06-26 10:11:03 +02:00
parent 9508a89a1b
commit db331e054a

View File

@@ -594,7 +594,6 @@ void VariableBoxController::loadCurrentVariablesInScript(const char * scriptCont
// Keep only MP_TOKEN_NAME tokens
if (lex->tok_kind == MP_TOKEN_NAME) {
const char * name = lex->vstr.buf;
int nameLength = lex->vstr.len;
/* If the token autocompletes the text and it is not already in the
@@ -612,7 +611,7 @@ void VariableBoxController::loadCurrentVariablesInScript(const char * scriptCont
}
assert(beginningLineIndex == line);
const char * tokenInText = beginningLine + lex->tok_column - 1; // tok_column starts at 1, not 0
assert(strncmp(tokenInText, name, nameLength) == 0);
assert(strncmp(tokenInText, lex->vstr.buf, nameLength) == 0);
ScriptNode::Type nodeType = (defToken || *(tokenInText + nameLength) == '(')? ScriptNode::Type::WithParentheses : ScriptNode::Type::WithoutParentheses;
if (addNodeIfMatches(textToAutocomplete, textToAutocompleteLength, nodeType, origin, tokenInText, nameLength)) {