From 42ef3b28a22e0dcc29706aa79be8a44de5092c67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 28 May 2003 09:54:27 +0000 Subject: [PATCH] Bug:1050 Remove caching. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7058 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/lyxtextclass.C | 18 ++---------------- 2 files changed, 6 insertions(+), 16 deletions(-) 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); } -- 2.39.5