浏览代码

Simplify buffer check when adding a registered variable

James Urquhart 10 年之前
父节点
当前提交
e5c28b4d7f
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Engine/source/console/consoleInternal.cpp

+ 1 - 2
Engine/source/console/consoleInternal.cpp

@@ -693,8 +693,7 @@ Dictionary::Entry* Dictionary::addVariable(  const char *name,
    Entry *ent = add(StringTable->insert(name));
    
    if (  ent->value.type <= ConsoleValue::TypeInternalString &&
-         ent->value.sval != typeValueEmpty && 
-         ent->value.type != ConsoleValue::TypeInternalStackString && ent->value.type != ConsoleValue::TypeInternalStringStackPtr )
+         ent->value.bufferLen > 0 )
       dFree(ent->value.sval);
 
    ent->value.type = type;