develooper Front page | perl.cvs.parrot | Postings from February 2008

[svn:parrot] r26142 - trunk/compilers/imcc

From:
petdance
Date:
February 29, 2008 21:16
Subject:
[svn:parrot] r26142 - trunk/compilers/imcc
Author: petdance
Date: Fri Feb 29 21:16:00 2008
New Revision: 26142

Modified:
   trunk/compilers/imcc/symreg.c

Log:
fix a sign mismatch.  Move a cheap comparison before an expensive one.

Modified: trunk/compilers/imcc/symreg.c
==============================================================================
--- trunk/compilers/imcc/symreg.c	(original)
+++ trunk/compilers/imcc/symreg.c	Fri Feb 29 21:16:00 2008
@@ -161,11 +161,11 @@
 static SymReg *
 _get_sym_typed(ARGIN(const SymHash *hsh), ARGIN(const char *name), int t)
 {
-    const int i = hash_str(name) % hsh->size;
+    const unsigned int i = hash_str(name) % hsh->size;
     SymReg   *p;
 
     for (p = hsh->data[i]; p; p = p->next) {
-        if (STREQ(name, p->name) && (t == p->set))
+        if ((t == p->set) && STREQ(name, p->name))
             return p;
     }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About