From: Richard Kreckel Date: Wed, 10 Apr 2002 20:02:56 +0000 (+0000) Subject: * expairseq::calchash(): Remove one superfluous rotation. X-Git-Tag: release_1-1-0~103 X-Git-Url: https://ginac.de/ginac.git/tutorial/ginac.git?a=commitdiff_plain;h=77448d8b1f403d182659fd43ef2d82b8945c3938;p=ginac.git * expairseq::calchash(): Remove one superfluous rotation. --- diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index e63dbbeb..4257c3c7 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -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; }