Replace "size()" with "empty()".
This commit is contained in:
parent
6ef3be23fd
commit
00693ba075
7 changed files with 8 additions and 8 deletions
|
@ -44,7 +44,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
|
||||||
|
|
||||||
std::vector<std::string> flash_version_numbers = base::SplitString(
|
std::vector<std::string> flash_version_numbers = base::SplitString(
|
||||||
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
if (flash_version_numbers.size() < 1)
|
if (flash_version_numbers.empty())
|
||||||
flash_version_numbers.push_back("11");
|
flash_version_numbers.push_back("11");
|
||||||
// |SplitString()| puts in an empty string given an empty string. :(
|
// |SplitString()| puts in an empty string given an empty string. :(
|
||||||
else if (flash_version_numbers[0].empty())
|
else if (flash_version_numbers[0].empty())
|
||||||
|
|
|
@ -427,7 +427,7 @@ void OnClientCertificateSelected(
|
||||||
|
|
||||||
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
||||||
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
|
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
|
||||||
if (certs.size() > 0)
|
if (!certs.empty())
|
||||||
delegate->ContinueWithCertificate(certs[0].get());
|
delegate->ContinueWithCertificate(certs[0].get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
|
||||||
void AutoUpdater::QuitAndInstall() {
|
void AutoUpdater::QuitAndInstall() {
|
||||||
// If we don't have any window then quitAndInstall immediately.
|
// If we don't have any window then quitAndInstall immediately.
|
||||||
WindowList* window_list = WindowList::GetInstance();
|
WindowList* window_list = WindowList::GetInstance();
|
||||||
if (window_list->size() == 0) {
|
if (window_list->empty()) {
|
||||||
auto_updater::AutoUpdater::QuitAndInstall();
|
auto_updater::AutoUpdater::QuitAndInstall();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ void Browser::Quit() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||||
if (window_list->size() == 0)
|
if (window_list->empty())
|
||||||
NotifyAndShutdown();
|
NotifyAndShutdown();
|
||||||
|
|
||||||
window_list->CloseAllWindows();
|
window_list->CloseAllWindows();
|
||||||
|
@ -66,7 +66,7 @@ void Browser::Exit(mate::Arguments* args) {
|
||||||
|
|
||||||
// Must destroy windows before quitting, otherwise bad things can happen.
|
// Must destroy windows before quitting, otherwise bad things can happen.
|
||||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||||
if (window_list->size() == 0) {
|
if (window_list->empty()) {
|
||||||
Shutdown();
|
Shutdown();
|
||||||
} else {
|
} else {
|
||||||
// Unlike Quit(), we do not ask to close window, but destroy the window
|
// Unlike Quit(), we do not ask to close window, but destroy the window
|
||||||
|
|
|
@ -164,7 +164,7 @@ void NodeDebugger::DidRead(net::test_server::StreamListenSocket* socket,
|
||||||
buffer_.append(data, len);
|
buffer_.append(data, len);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (buffer_.size() == 0)
|
if (buffer_.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Read the "Content-Length" header.
|
// Read the "Content-Length" header.
|
||||||
|
|
|
@ -319,7 +319,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
|
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
|
||||||
withSettings:(const mate::PersistentDictionary&)settings {
|
withSettings:(const mate::PersistentDictionary&)settings {
|
||||||
std::vector<std::string> colors;
|
std::vector<std::string> colors;
|
||||||
if (settings.Get("availableColors", &colors) && colors.size() > 0) {
|
if (settings.Get("availableColors", &colors) && !colors.empty()) {
|
||||||
NSColorList* color_list = [[[NSColorList alloc] initWithName:@""] autorelease];
|
NSColorList* color_list = [[[NSColorList alloc] initWithName:@""] autorelease];
|
||||||
for (size_t i = 0; i < colors.size(); ++i) {
|
for (size_t i = 0; i < colors.size(); ++i) {
|
||||||
[color_list insertColor:[self colorFromHexColorString:colors[i]]
|
[color_list insertColor:[self colorFromHexColorString:colors[i]]
|
||||||
|
|
|
@ -46,7 +46,7 @@ void WindowList::RemoveWindow(NativeWindow* window) {
|
||||||
for (WindowListObserver& observer : observers_.Get())
|
for (WindowListObserver& observer : observers_.Get())
|
||||||
observer.OnWindowRemoved(window);
|
observer.OnWindowRemoved(window);
|
||||||
|
|
||||||
if (windows.size() == 0) {
|
if (windows.empty()) {
|
||||||
for (WindowListObserver& observer : observers_.Get())
|
for (WindowListObserver& observer : observers_.Get())
|
||||||
observer.OnWindowAllClosed();
|
observer.OnWindowAllClosed();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue