Skip to content
Snippets Groups Projects
Commit 22a73944 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Various cleanups to container usage and change to emplace

parent 8156fc9a
Branches
Tags
No related merge requests found
...@@ -583,7 +583,7 @@ class LLDependencies: public LLDependenciesBase ...@@ -583,7 +583,7 @@ class LLDependencies: public LLDependenciesBase
if (found != non_const_this->mNodes.end()) if (found != non_const_this->mNodes.end())
{ {
// Make an iterator of appropriate type. // Make an iterator of appropriate type.
mCache.push_back(iterator(found, value_extract)); mCache.emplace_back(iterator(found, value_extract));
} }
} }
} }
......
...@@ -63,9 +63,9 @@ class LLDictionary : public std::map<Index, Entry *> ...@@ -63,9 +63,9 @@ class LLDictionary : public std::map<Index, Entry *>
} }
const Index lookup(const std::string_view name) const const Index lookup(const std::string_view name) const
{ {
for (const_iterator_t dictionary_iter = map_t::begin(); for (const_iterator_t dictionary_iter = map_t::begin(), end_iter = map_t::end();
dictionary_iter != map_t::end(); dictionary_iter != end_iter;
dictionary_iter++) ++dictionary_iter)
{ {
const Entry *entry = dictionary_iter->second; const Entry *entry = dictionary_iter->second;
if (entry->mName == name) if (entry->mName == name)
......
...@@ -71,7 +71,7 @@ void LLFixedBuffer::addWLine(const LLWString& line) ...@@ -71,7 +71,7 @@ void LLFixedBuffer::addWLine(const LLWString& line)
mMutex.lock() ; mMutex.lock() ;
mLines.push_back(line); mLines.push_back(line);
mLineLengths.push_back((S32)line.length()); mLineLengths.push_back((S32)line.length());
mAddTimes.push_back(mTimer.getElapsedTimeF32()); mAddTimes.emplace_back(mTimer.getElapsedTimeF32());
mMutex.unlock() ; mMutex.unlock() ;
} }
......
...@@ -106,11 +106,11 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) ...@@ -106,11 +106,11 @@ bool ll_get_stack_trace(std::vector<std::string>& lines)
if(ret) if(ret)
{ {
std::string file_name = line.FileName; std::string file_name = line.FileName;
std::string::size_type index = file_name.rfind("\\"); std::string::size_type index = file_name.rfind('\\');
stack_line << file_name.substr(index + 1, file_name.size()) << ":" << line.LineNumber; stack_line << file_name.substr(index + 1, file_name.size()) << ":" << line.LineNumber;
} }
lines.push_back(stack_line.str()); lines.emplace_back(stack_line.str());
} }
free(pSym); free(pSym);
......
...@@ -134,7 +134,7 @@ class LLGenericStreamQueue ...@@ -134,7 +134,7 @@ class LLGenericStreamQueue
// you might have to recopy all previous contents to grow its size. If // you might have to recopy all previous contents to grow its size. If
// we want this to scale to large data volumes, better to allocate // we want this to scale to large data volumes, better to allocate
// individual pieces. // individual pieces.
mBuffer.push_back(string(s, n)); mBuffer.emplace_back(string(s, n));
mSize += n; mSize += n;
return n; return n;
} }
......
...@@ -1329,7 +1329,6 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, ...@@ -1329,7 +1329,6 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
// if never fell into those two ifs above, param must be utc // if never fell into those two ifs above, param must be utc
if (secFromEpoch < 0) secFromEpoch = 0; if (secFromEpoch < 0) secFromEpoch = 0;
LLDate datetime((F64)secFromEpoch);
std::string code = LLStringOps::getDatetimeCode (token); std::string code = LLStringOps::getDatetimeCode (token);
// special case to handle timezone // special case to handle timezone
...@@ -1340,7 +1339,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, ...@@ -1340,7 +1339,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
} }
else if (param == "local") else if (param == "local")
{ {
replacement = ""; // user knows their own timezone replacement.clear(); // user knows their own timezone
} }
else else
{ {
...@@ -1400,6 +1399,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, ...@@ -1400,6 +1399,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
} }
else else
{ {
LLDate datetime((F64)secFromEpoch);
replacement = datetime.toHTTPDateString(code); replacement = datetime.toHTTPDateString(code);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment