X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fbasic.cpp;h=1d5f695a5e25873191f4ddb490849dabc4f5228d;hb=HEAD;hp=6abe4727a424a0622fd2569f2956a0f2c6ad65cd;hpb=c12c8ec3c5cf0c75f061f6c52d04206277bbdcca;p=ginac.git diff --git a/ginac/basic.cpp b/ginac/basic.cpp index 6abe4727..b5f97cda 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's ABC. */ /* - * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2024 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 @@ -373,7 +373,7 @@ ex basic::collect(const ex & s, bool distributed) const pre_coeff = pre_coeff.coeff(li, cexp); key *= pow(li, cexp); } - exmap::iterator ci = cmap.find(key); + auto ci = cmap.find(key); if (ci != cmap.end()) ci->second += pre_coeff; else @@ -585,10 +585,11 @@ bool basic::match(const ex & pattern, exmap& repl_lst) const ex basic::subs_one_level(const exmap & m, unsigned options) const { if (options & subs_options::no_pattern) { - auto it = m.find(*this); + ex thisex = *this; // NB: *this may be deleted here. + auto it = m.find(thisex); if (it != m.end()) return it->second; - return *this; + return thisex; } else { for (auto & it : m) { exmap repl_lst; @@ -901,9 +902,6 @@ void basic::ensure_if_modifiable() const // global variables ////////// -int max_recursion_level = 1024; - - #ifdef GINAC_COMPARE_STATISTICS compare_statistics_t::~compare_statistics_t() {