]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
calchash(): work around broken RTTI.
[ginac.git] / ginac / basic.cpp
index ff1f7a04f5f769d2501600ad807031efd2f3cb6a..f9f18f5ca13b8f6e0a82ba54b2a5a1ae4cba7991 100644 (file)
@@ -33,6 +33,7 @@
 #include "wildcard.h"
 #include "archive.h"
 #include "utils.h"
+#include "hash_seed.h"
 #include "inifcns.h"
 
 #include <iostream>
@@ -780,8 +781,7 @@ return_type_t basic::return_type_tinfo() const
  *  would all end up with the same hashvalue. */
 unsigned basic::calchash() const
 {
-       const void* this_tinfo = (const void*)typeid(*this).name();
-       unsigned v = golden_ratio_hash((p_int)this_tinfo);
+       unsigned v = make_hash_seed(typeid(*this));
        for (size_t i=0; i<nops(); i++) {
                v = rotate_left(v);
                v ^= this->op(i).gethash();