Remove caching.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7058 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-05-28 09:54:27 +00:00
parent d5f3bad9bb
commit 42ef3b28a2
2 changed files with 6 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2003-05-28 Lars Gullik Bjønnes <larsbj@lyx.org>
* lyxtextclass.C (operator): remove caching.
2003-05-27 Lars Gullik Bjønnes <larsbj@gullik.net>
* text3.C: adjust

View File

@ -753,20 +753,9 @@ bool LyXTextClass::hasLayout(string const & n) const
LyXLayout_ptr const & LyXTextClass::operator[](string const & n) const
LyXLayout_ptr const & LyXTextClass::operator[](string const & name) const
{
lyx::Assert(!n.empty());
if (n.empty())
lyxerr << "LyXTextClass::operator[] called with empty n" << endl;
string const name = (n.empty() ? defaultLayoutName() : n);
static string lastLayoutName;
static LayoutList::difference_type lastLayoutIndex;
if (name == lastLayoutName)
return layoutlist_[lastLayoutIndex];
lyx::Assert(!name.empty());
LayoutList::const_iterator cit =
find_if(layoutlist_.begin(),
@ -785,9 +774,6 @@ LyXLayout_ptr const & LyXTextClass::operator[](string const & n) const
lyx::Assert(false);
}
lastLayoutName = name;
lastLayoutIndex = std::distance(layoutlist_.begin(), cit);
return (*cit);
}