]> www.ginac.de Git - ginac.git/blobdiff - ginac/expairseq.cpp
Add trivial shortcuts in expair plumbing of class add.
[ginac.git] / ginac / expairseq.cpp
index c1cb45374d90d587d3ac30f044282eebf53423d3..b29f3802c13f2be0f0a55977d6b129c00dd2cdad 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of sequences of expression pairs. */
 
 /*
- *  GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2015 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
@@ -32,6 +32,7 @@
 #include "utils.h"
 #include "hash_seed.h"
 #include "indexed.h"
+#include "compiler.h"
 
 #include <algorithm>
 #if EXPAIRSEQ_USE_HASHTAB
@@ -661,7 +662,7 @@ ex expairseq::expand(unsigned options) const
  *  has (at least) two possible different semantics but we want to inherit
  *  methods thus avoiding code duplication.  Sometimes a method in expairseq
  *  has to create a new one of the same semantics, which cannot be done by a
- *  ctor because the name (add, mul,...) is unknown on the expaiseq level.  In
+ *  ctor because the name (add, mul,...) is unknown on the expairseq level.  In
  *  order for this trick to work a derived class must of course override this
  *  definition. */
 ex expairseq::thisexpairseq(const epvector &v, const ex &oc, bool do_index_renaming) const
@@ -1524,7 +1525,7 @@ bool expairseq::is_canonical() const
                return 1;
        
 #if EXPAIRSEQ_USE_HASHTAB
-       if (hashtabsize > 0) return 1; // not canoncalized
+       if (hashtabsize > 0) return 1; // not canonicalized
 #endif // EXPAIRSEQ_USE_HASHTAB
        
        epvector::const_iterator it = seq.begin(), itend = seq.end();
@@ -1610,7 +1611,7 @@ std::auto_ptr<epvector> expairseq::evalchildren(int level) const
        // returns a pointer to a newly created epvector otherwise
        // (which has to be deleted somewhere else)
 
-       if (level==1)
+       if (likely(level==1))
                return std::auto_ptr<epvector>(0);
        
        if (level == -max_recursion_level)