]> www.ginac.de Git - ginac.git/blobdiff - ginac/symmetry.cpp
symbol: remove return_type_tinfo() and return_type() (shrink symbol by 8 bytes)
[ginac.git] / ginac / symmetry.cpp
index 6ab0944dd79882d7dd4284a800f4fdf45a9fb06c..dd3029e5b48be96ed682b5432de4513940b1a796 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symmetry definitions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@ GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(symmetry, basic,
 // default constructor
 //////////
 
-symmetry::symmetry() : inherited(&symmetry::tinfo_static), type(none)
+symmetry::symmetry() :  type(none)
 {
        setflag(status_flags::evaluated | status_flags::expanded);
 }
@@ -65,13 +65,13 @@ symmetry::symmetry() : inherited(&symmetry::tinfo_static), type(none)
 // other constructors
 //////////
 
-symmetry::symmetry(unsigned i) : inherited(&symmetry::tinfo_static), type(none)
+symmetry::symmetry(unsigned i) :  type(none)
 {
        indices.insert(i);
        setflag(status_flags::evaluated | status_flags::expanded);
 }
 
-symmetry::symmetry(symmetry_type t, const symmetry &c1, const symmetry &c2) : inherited(&symmetry::tinfo_static), type(t)
+symmetry::symmetry(symmetry_type t, const symmetry &c1, const symmetry &c2) :  type(t)
 {
        add(c1); add(c2);
        setflag(status_flags::evaluated | status_flags::expanded);
@@ -185,7 +185,8 @@ int symmetry::compare_same_type(const basic & other) const
 
 unsigned symmetry::calchash() const
 {
-       unsigned v = golden_ratio_hash((p_int)tinfo());
+       const void* this_tinfo = (const void*)typeid(*this).name();
+       unsigned v = golden_ratio_hash((p_int)this_tinfo);
 
        if (type == none) {
                v = rotate_left(v);