DEV-38598: remove dangerous compare-LLSD-less-than operation

meow-7.2.2
Nat Goodspeed 2009-09-12 09:11:32 -04:00
parent d40d745cba
commit 689af4b329
2 changed files with 14 additions and 1 deletions

View File

@ -146,6 +146,16 @@ LLFloater::handle_map_t LLFloater::sFloaterMap;
LLFloaterView* gFloaterView = NULL;
/*==========================================================================*|
// DEV-38598: The fundamental problem with this operation is that it can only
// support a subset of LLSD values. While it's plausible to compare two arrays
// lexicographically, what strict ordering can you impose on maps?
// (LLFloaterTOS's current key is an LLSD map.)
// Of course something like this is necessary if you want to build a std::set
// or std::map with LLSD keys. Fortunately we're getting by with other
// container types for now.
//static
bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b)
{
@ -173,6 +183,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b)
else
return false; // no valid operation for Binary
}
|*==========================================================================*/
bool LLFloater::KeyCompare::equate(const LLSD& a, const LLSD& b)
{

View File

@ -87,12 +87,14 @@ friend class LLMultiFloater;
public:
struct KeyCompare
{
static bool compare(const LLSD& a, const LLSD& b);
// static bool compare(const LLSD& a, const LLSD& b);
static bool equate(const LLSD& a, const LLSD& b);
/*==========================================================================*|
bool operator()(const LLSD& a, const LLSD& b) const
{
return compare(a, b);
}
|*==========================================================================*/
};
enum EFloaterButtons