diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 6b6a9500e0a8ff932a3c681769c410642ef8ac21..6bc5331dc24ea1387f637e49e40c51662616b593 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -583,7 +583,7 @@ class LLDependencies: public LLDependenciesBase if (found != non_const_this->mNodes.end()) { // Make an iterator of appropriate type. - mCache.push_back(iterator(found, value_extract)); + mCache.emplace_back(iterator(found, value_extract)); } } } diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index a4dbe43f41752bc9cf448f52b056bbce217fac02..7dd889a62b423df692ffe8d5469f5fc45c06a094 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -63,9 +63,9 @@ class LLDictionary : public std::map<Index, Entry *> } const Index lookup(const std::string_view name) const { - for (const_iterator_t dictionary_iter = map_t::begin(); - dictionary_iter != map_t::end(); - dictionary_iter++) + for (const_iterator_t dictionary_iter = map_t::begin(), end_iter = map_t::end(); + dictionary_iter != end_iter; + ++dictionary_iter) { const Entry *entry = dictionary_iter->second; if (entry->mName == name) diff --git a/indra/llcommon/llfixedbuffer.cpp b/indra/llcommon/llfixedbuffer.cpp index bd4db8be845528e0524ba15f4333f949c8419361..bf2f15d13f9c8aff74ba000e447f6ce8b3e46141 100644 --- a/indra/llcommon/llfixedbuffer.cpp +++ b/indra/llcommon/llfixedbuffer.cpp @@ -71,7 +71,7 @@ void LLFixedBuffer::addWLine(const LLWString& line) mMutex.lock() ; mLines.push_back(line); mLineLengths.push_back((S32)line.length()); - mAddTimes.push_back(mTimer.getElapsedTimeF32()); + mAddTimes.emplace_back(mTimer.getElapsedTimeF32()); mMutex.unlock() ; } diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index 80057bf0f2147dea3401ad0c05a800752376e454..8a136f0f6c8bce49bfe60cb82f8ff4313ea1098b 100644 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -106,11 +106,11 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) if(ret) { 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; } - lines.push_back(stack_line.str()); + lines.emplace_back(stack_line.str()); } free(pSym); diff --git a/indra/llcommon/llstreamqueue.h b/indra/llcommon/llstreamqueue.h index 0726bad1757679f14f5099e27459799d6ccb3dfc..8d7e9d8d5bee69e4efdd30a5d32846d6125eb67b 100644 --- a/indra/llcommon/llstreamqueue.h +++ b/indra/llcommon/llstreamqueue.h @@ -134,7 +134,7 @@ class LLGenericStreamQueue // 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 // individual pieces. - mBuffer.push_back(string(s, n)); + mBuffer.emplace_back(string(s, n)); mSize += n; return n; } diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 4d63492a4ede0c0f372a33dc9c4ec9b0a301b883..fea9cb10b80a75fcb8c4d8d4a1f88541dc7dbf21 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -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 (secFromEpoch < 0) secFromEpoch = 0; - LLDate datetime((F64)secFromEpoch); std::string code = LLStringOps::getDatetimeCode (token); // special case to handle timezone @@ -1340,7 +1339,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, } else if (param == "local") { - replacement = ""; // user knows their own timezone + replacement.clear(); // user knows their own timezone } else { @@ -1400,6 +1399,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, } else { + LLDate datetime((F64)secFromEpoch); replacement = datetime.toHTTPDateString(code); }