From 5a83247f038e327465bf88127f60750306507ed3 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 22 Jan 2010 14:03:13 -0800 Subject: Fix assert in lldictionary as used by llfoldertype Review #88 This assert might be valid in general, but LLFolderType has a valid reason for getting "not found" --- indra/llcommon/lldictionary.h | 9 +++++++-- indra/llcommon/llfoldertype.cpp | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 95178b41e7..4a2bfb9f3f 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -76,11 +76,16 @@ public: return dictionary_iter->first; } } - llassert(false); - return Index(-1); + return notFound(); } protected: + virtual Index notFound() const + { + // default is to assert + llassert(false); + return Index(-1); + } void addEntry(Index index, Entry *entry) { if (lookup(index)) diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 079e670b1a..2610fe9e6a 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -59,6 +59,11 @@ class LLFolderDictionary : public LLSingleton, { public: LLFolderDictionary(); +protected: + virtual LLFolderType::EType notFound() const + { + return LLFolderType::FT_NONE; + } }; LLFolderDictionary::LLFolderDictionary() -- cgit v1.2.3