summaryrefslogtreecommitdiff
path: root/heap/hp_hash.c
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2002-08-15 16:42:54 +0500
committerunknown <bar@bar.mysql.r18.ru>2002-08-15 16:42:54 +0500
commitbf5b046e841121c4250bd668449df99302de31ea (patch)
tree0771a890e5d8ed36e182ce6069988f32b9db0bc7 /heap/hp_hash.c
parent6cc0d7d7e8d8321ecd2d918cb0e3160eb0322ecd (diff)
downloadmariadb-git-bf5b046e841121c4250bd668449df99302de31ea.tar.gz
Some speed improvements
Diffstat (limited to 'heap/hp_hash.c')
-rw-r--r--heap/hp_hash.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index 424322fd5e7..4f7dc956cba 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -217,11 +217,14 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
if (seg->charset->hash_sort)
seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
else
- for (; pos < (uchar*) key ; pos++)
{
- nr^=(ulong) ((((uint) nr & 63)+nr2) *
- ((uint) seg->charset->sort_order[(uint) *pos])) + (nr << 8);
- nr2+=3;
+ register uchar *sort_order=seg->charset->sort_order;
+ for (; pos < (uchar*) key ; pos++)
+ {
+ nr^=(ulong) ((((uint) nr & 63)+nr2) *
+ ((uint) sort_order[(uint) *pos])) + (nr << 8);
+ nr2+=3;
+ }
}
}
else
@@ -260,11 +263,15 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
if (seg->charset->hash_sort)
seg->charset->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
else
- for (; pos < end ; pos++)
{
- nr^=(ulong) ((((uint) nr & 63)+nr2)*
- ((uint) seg->charset->sort_order[(uint) *pos]))+ (nr << 8);
- nr2+=3;
+ register uchar *sort_order=seg->charset->sort_order;
+
+ for (; pos < end ; pos++)
+ {
+ nr^=(ulong) ((((uint) nr & 63)+nr2)*
+ ((uint) sort_order[(uint) *pos]))+ (nr << 8);
+ nr2+=3;
+ }
}
}
else