]> www.ginac.de Git - ginac.git/blobdiff - ginac/normal.cpp
Fix little missed optimization.
[ginac.git] / ginac / normal.cpp
index e0920b36efdbc6dd8a8d3ab37212bae34c27584e..c6dc39e6b0ef1d4108a5dcfeb4628054f3b5a9f4 100644 (file)
@@ -120,6 +120,11 @@ static bool get_first_symbol(const ex &e, ex &x)
  *
  *  @see get_symbol_stats */
 struct sym_desc {
+       /** Initialize symbol, leave other variables uninitialized */
+       sym_desc(const ex& s)
+         : sym(s), deg_a(0), deg_b(0), ldeg_a(0), ldeg_b(0), max_deg(0), max_lcnops(0)
+       { }
+
        /** Reference to symbol */
        ex sym;
 
@@ -161,9 +166,7 @@ static void add_symbol(const ex &s, sym_desc_vec &v)
                if (it.sym.is_equal(s))  // If it's already in there, don't add it a second time
                        return;
 
-       sym_desc d;
-       d.sym = s;
-       v.push_back(d);
+       v.push_back(sym_desc(s));
 }
 
 // Collect all symbols of an expression (used internally by get_symbol_stats())