Small performance improvement to getVarName