[apps/code] Replace if with assertion

This commit is contained in:
Léa Saviot
2020-05-25 09:59:01 +02:00
committed by Émilie Feral
parent b466a8711b
commit 6b558c3328

View File

@@ -154,17 +154,11 @@ int VariableBoxController::typeAtLocation(int i, int j) {
}
void VariableBoxController::loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength) {
assert(scriptIndex >= 0);
// Reset the node counts
empty();
if (scriptIndex < 0) {
/* If not script index is given, the variable box is loaded from console. We
* only want to load imported script variables. */
assert(textToAutocomplete == nullptr);
loadVariablesImportedFromScripts();
return;
}
if (textToAutocomplete != nullptr && textToAutocompleteLength < 0) {
textToAutocompleteLength = strlen(textToAutocomplete);
}