1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-01 00:57:11 +00:00

Minor code optimization.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5883 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-10-27 19:32:42 +00:00
parent 757b400aa1
commit a3ae2e9125

View File

@ -429,14 +429,17 @@ SymEntry* SymFindAny (SymTable* Scope, const StrBuf* Name)
* scope.
*/
{
/* Generate the name hash */
unsigned Hash = HashBuf (Name);
/* Search for the symbol */
SymEntry* Sym;
do {
/* Search in the current table. Ignore entries flagged with SF_UNUSED,
* because for such symbols there is a real entry in one of the parent
* scopes.
*/
unsigned Hash = HashBuf (Name) % Scope->TableSlots;
if (SymSearchTree (Scope->Table[Hash], Name, &Sym) == 0) {
if (SymSearchTree (Scope->Table[Hash % Scope->TableSlots], Name, &Sym) == 0) {
if (Sym->Flags & SF_UNUSED) {
Sym = 0;
} else {