* in GiNaC functions */
/*
- * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2002 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
{
GINAC_ASSERT(f.seq.size()==seq.size());
if (f.gethash()!=hashvalue) return false;
- for (unsigned i=0; i<seq.size(); ++i)
+ unsigned num = seq.size();
+ for (unsigned i=0; i<num; ++i)
if (!seq[i].is_equal(f.seq[i])) return false;
++last_access = access_counter;
++successful_hits;
bool remember_table_list::lookup_entry(function const & f, ex & result) const
{
- for (const_iterator cit=begin(); cit!=end(); ++cit) {
- if ((*cit).is_equal(f)) {
- result = (*cit).get_result();
+ const_iterator i = begin(), iend = end();
+ while (i != iend) {
+ if (i->is_equal(f)) {
+ result = i->get_result();
return true;
}
+ ++i;
}
return false;
}