From: Lars Gullik Bjønnes Date: Wed, 28 May 2003 09:54:27 +0000 (+0000) Subject: Bug:1050 X-Git-Tag: 1.6.10~16734 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=42ef3b28a22e0dcc29706aa79be8a44de5092c67;p=features.git Bug:1050 Remove caching. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7058 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 9ac1eaa903..65de4190cc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-05-28 Lars Gullik Bjønnes + + * lyxtextclass.C (operator): remove caching. + 2003-05-27 Lars Gullik Bjønnes * text3.C: adjust diff --git a/src/lyxtextclass.C b/src/lyxtextclass.C index f406915a85..74be61056f 100644 --- a/src/lyxtextclass.C +++ b/src/lyxtextclass.C @@ -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); }