Bug 1387002 - Replace .size() by .empty() when applicable in profiler/ r?njn
MozReview-Commit-ID: 275AVJyhejr
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -190,22 +190,22 @@ private:
: mProcessStartTime(TimeStamp::ProcessCreation())
#ifdef USE_LUL_STACKWALK
, mLul(nullptr)
#endif
{}
~CorePS()
{
- while (mLiveThreads.size() > 0) {
+ while (!mLiveThreads.empty()) {
delete mLiveThreads.back();
mLiveThreads.pop_back();
}
- while (mDeadThreads.size() > 0) {
+ while (!mDeadThreads.empty()) {
delete mDeadThreads.back();
mDeadThreads.pop_back();
}
}
public:
typedef std::vector<ThreadInfo*> ThreadVector;
@@ -2835,17 +2835,17 @@ locked_profiler_stop(PSLockRef aLock)
}
}
info->StopProfiling();
}
}
// This is where we destroy the ThreadInfos for all dead threads.
CorePS::ThreadVector& deadThreads = CorePS::DeadThreads(aLock);
- while (deadThreads.size() > 0) {
+ while (!deadThreads.empty()) {
delete deadThreads.back();
deadThreads.pop_back();
}
// The Stop() call doesn't actually stop Run(); that happens in this
// function's caller when the sampler thread is destroyed. Stop() just gives
// the SamplerThread a chance to do some cleanup with gPSMutex locked.
SamplerThread* samplerThread = ActivePS::Destroy(aLock);
--- a/tools/profiler/core/shared-libraries-linux.cc
+++ b/tools/profiler/core/shared-libraries-linux.cc
@@ -192,17 +192,17 @@ SharedLibraryInfo SharedLibraryInfo::Get
#if defined(GP_OS_linux)
// Make another pass over the information we just harvested from
// dl_iterate_phdr. If we see a nameless object mapped at what we earlier
// established to be the main executable's load address, attach the
// executable's name to that entry.
for (size_t i = 0; i < info.GetSize(); i++) {
SharedLibrary& lib = info.GetMutableEntry(i);
- if (lib.GetStart() == exeExeAddr && lib.GetNativeDebugPath() == "") {
+ if (lib.GetStart() == exeExeAddr && lib.GetNativeDebugPath().empty()) {
lib = SharedLibraryAtPath(exeName, lib.GetStart(), lib.GetEnd(),
lib.GetOffset());
// We only expect to see one such entry.
break;
}
}
#endif