]> www.ginac.de Git - ginac.git/commitdiff
* expairseq::calchash(): Remove one superfluous rotation.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 10 Apr 2002 20:02:56 +0000 (20:02 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 10 Apr 2002 20:02:56 +0000 (20:02 +0000)
ginac/expairseq.cpp

index e63dbbebbf684051e5a305f3a7774d76a8a03626..4257c3c7dd7e108ded8c7b9e9da08d205c44421b 100644 (file)
@@ -549,16 +549,15 @@ unsigned expairseq::return_type(void) const
 unsigned expairseq::calchash(void) const
 {
        unsigned v = golden_ratio_hash(this->tinfo());
-       epvector::const_iterator i = seq.begin(), end = seq.end();
+       epvector::const_iterator i = seq.begin();
+       const epvector::const_iterator end = seq.end();
        while (i != end) {
-#if !EXPAIRSEQ_USE_HASHTAB
-               v = rotate_left_31(v); // rotation would spoil commutativity
-#endif // EXPAIRSEQ_USE_HASHTAB
                v ^= i->rest.gethash();
 #if !EXPAIRSEQ_USE_HASHTAB
+               // rotation spoils commutativity!
                v = rotate_left_31(v);
                v ^= i->coeff.gethash();
-#endif // EXPAIRSEQ_USE_HASHTAB
+#endif // !EXPAIRSEQ_USE_HASHTAB
                ++i;
        }