Simplify logic, clean up code.

This commit is contained in:
Lirusaito
2019-02-27 06:08:19 -05:00
parent 3b9a0cfbc8
commit e3ca2594bc
2 changed files with 9 additions and 17 deletions

View File

@@ -81,7 +81,7 @@ const std::string& HippoGridInfo::getGridOwner() const
}
else
{
return this->getGridName();
return getGridName();
}
}
@@ -102,8 +102,7 @@ void HippoGridInfo::setPlatform(Platform platform)
void HippoGridInfo::setPlatform(const std::string& platform)
{
std::string tmp = platform;
for (unsigned i=0; i<platform.size(); i++)
tmp[i] = tolower(tmp[i]);
LLStringUtil::toLower(tmp);
if (tmp == "aurora" || tmp == "whitecore")
{
@@ -120,7 +119,7 @@ void HippoGridInfo::setPlatform(const std::string& platform)
else
{
setPlatform(PLATFORM_OTHER);
LL_WARNS() << "Unknown platform '" << platform << "' for " << mGridName << "." << LL_ENDL;
LL_WARNS() << "Unknown platform '" << platform << "' for " << mGridName << '.' << LL_ENDL;
}
}
@@ -337,7 +336,7 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le
case XML_GRIDNAME:
{
if (self->mGridName == "")
if (self->mGridName.empty())
{
self->mGridName.assign(s, len);
}
@@ -366,7 +365,7 @@ void HippoGridInfo::getGridInfo()
// Make sure the uri ends on a '/'.
std::string uri = mLoginUri;
if (uri.compare(uri.length() - 1, 1, "/") != 0)
if (uri.back() != '/')
{
uri += '/';
}
@@ -482,7 +481,7 @@ std::string HippoGridInfo::getGridNick() const
// static
const char* HippoGridInfo::getPlatformString(Platform platform)
{
static const char* platformStrings[PLATFORM_LAST] =
constexpr const char* platformStrings[PLATFORM_LAST] =
{
"Other", "WhiteCore", "OpenSim", "SecondLife"
};

View File

@@ -3187,16 +3187,9 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren
return LLFloaterView::handleKey(key, mask, called_from_parent);
}
if (called_from_parent)
{
// pass all keystrokes down
LLFloaterView::handleKey(key, mask, called_from_parent);
}
else
{
// bounce keystrokes back down
LLFloaterView::handleKey(key, mask, TRUE);
}
// pass all keystrokes down
// bounce keystrokes back down
LLFloaterView::handleKey(key, mask, TRUE);
return TRUE;
}