From 77448d8b1f403d182659fd43ef2d82b8945c3938 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Wed, 10 Apr 2002 20:02:56 +0000 Subject: [PATCH] * expairseq::calchash(): Remove one superfluous rotation. --- ginac/expairseq.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } -- 2.47.0