Why do you have checks to see if the strings begin with the newline character? Won't you meant the null character?
Other thing: there is a recurrent "problem" in her coding (it also happens in ArrayX):
This:
PHP Code:
stock bool:TravTrieSetCell(TravTrie:trie, const key[], any:value)
{
if(key[0] == '^n') return false;
new any:val;
if(!TravTrieGetCell(trie, key, val) )
{
new Array:iter;
if(!TrieGetCell(Trie:trie,"",any:iter)) return false;
ArrayPushString(Array:iter,key);
}
if(key[0] == '^n') return false;
TrieSetCell(Trie:trie,key,value);
return true;
}
should be:
PHP Code:
stock bool:TravTrieSetCell(TravTrie:trie, const key[], any:value)
{
if(key[0] == '^n') return false;
new any:val;
if(!TravTrieGetCell(trie, key, val) )
{
new Array:iter;
if(!TrieGetCell(Trie:trie,"",any:iter)) return false;
ArrayPushString(Array:iter,key);
if(key[0] == '^n') return false;
}
TrieSetCell(Trie:trie,key,value);
return true;
}
In keytable_natives.cpp she has
PHP Code:
if(a == end) a = handle->lower_bound(start);
if(a == end) a = handle->upper_bound(start);
if(a == end) return 0;
else len--;
It should be:
PHP Code:
if(a == end)
{
a = handle->lower_bound(start)
if(a == end)
a = handle->upper_bound(start);
}
if(a == end)
return 0
else
len--
Not that it matter that much to performance but i thought that she has extremely rigorous at coding. It seems that she prefers to compact the code instead of making it more accurate
__________________