Bug 1387002 - Replace .size() by .empty() when applicable in crashreporter/ r?ted
MozReview-Commit-ID: DNh3Pe3FYxG
--- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -301,17 +301,17 @@ bool LinuxPtraceDumper::ThreadsSuspend()
my_memmove(&threads_[i], &threads_[i + 1],
(threads_.size() - i - 1) * sizeof(threads_[i]));
}
threads_.resize(threads_.size() - 1);
--i;
}
}
threads_suspended_ = true;
- return threads_.size() > 0;
+ return !threads_.empty();
}
bool LinuxPtraceDumper::ThreadsResume() {
if (!threads_suspended_)
return false;
bool good = true;
for (size_t i = 0; i < threads_.size(); ++i)
good &= ResumeThread(threads_[i]);
--- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
+++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
@@ -594,17 +594,17 @@ class MinidumpWriter {
if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld))
return false;
mod->module_name_rva = ld.rva;
return true;
}
bool WriteMemoryListStream(MDRawDirectory* dirent) {
TypedMDRVA<uint32_t> list(&minidump_writer_);
- if (memory_blocks_.size()) {
+ if (!memory_blocks_.empty()) {
if (!list.AllocateObjectAndArray(memory_blocks_.size(),
sizeof(MDMemoryDescriptor)))
return false;
} else {
// Still create the memory list stream, although it will have zero
// memory blocks.
if (!list.Allocate())
return false;
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp
+++ b/toolkit/crashreporter/client/crashreporter_linux.cpp
@@ -538,17 +538,17 @@ bool UIShowCrashUI(const StringTable& fi
gCloseButton =
gtk_button_new_with_label(gStrings[ST_QUIT].c_str());
gtk_box_pack_start(GTK_BOX(buttonBox), gCloseButton, FALSE, FALSE, 0);
gtk_widget_set_can_default(gCloseButton, TRUE);
g_signal_connect(gCloseButton, "clicked", G_CALLBACK(CloseClicked), 0);
gRestartButton = 0;
- if (restartArgs.size() > 0) {
+ if (!restartArgs.empty()) {
gRestartButton = gtk_button_new_with_label(gStrings[ST_RESTART].c_str());
gtk_box_pack_start(GTK_BOX(buttonBox), gRestartButton, FALSE, FALSE, 0);
gtk_widget_set_can_default(gRestartButton, TRUE);
g_signal_connect(gRestartButton, "clicked", G_CALLBACK(RestartClicked), 0);
}
gtk_widget_grab_focus(gSubmitReportCheck);