using an entity's serial as hashcode
while writing an essay about hash-functions for school i stumbled over some text about hashtables in the wikipedia, and it says:
just like
in both mobile.cs and item.cs.
so, what do you think?
while writing an essay about hash-functions for school i stumbled over some text about hashtables in the wikipedia, and it says:
but since runuo's entities (mobiles & items) use the serial as a unique identifier already, wouldn't using the serial as create such a 'perfect hashtable' and maybe speed up runuo a little bit?The generally impossible/impractical ideal for a hash table's hash function is to map each key to a unique index (see perfect hashing), because this guarantees access to each data record in the first probe into the table.
just like
Code:
public override int GetHashCode() {
return (int)this.m_Serial;
}
so, what do you think?