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(
|
||||
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");
|
||||
// |SplitString()| puts in an empty string given an empty string. :(
|
||||
else if (flash_version_numbers[0].empty())
|
||||
|
|
|
@ -427,7 +427,7 @@ void OnClientCertificateSelected(
|
|||
|
||||
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
|
||||
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
|
||||
if (certs.size() > 0)
|
||||
if (!certs.empty())
|
||||
delegate->ContinueWithCertificate(certs[0].get());
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
|
|||
void AutoUpdater::QuitAndInstall() {
|
||||
// If we don't have any window then quitAndInstall immediately.
|
||||
WindowList* window_list = WindowList::GetInstance();
|
||||
if (window_list->size() == 0) {
|
||||
if (window_list->empty()) {
|
||||
auto_updater::AutoUpdater::QuitAndInstall();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ void Browser::Quit() {
|
|||
return;
|
||||
|
||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||
if (window_list->size() == 0)
|
||||
if (window_list->empty())
|
||||
NotifyAndShutdown();
|
||||
|
||||
window_list->CloseAllWindows();
|
||||
|
@ -66,7 +66,7 @@ void Browser::Exit(mate::Arguments* args) {
|
|||
|
||||
// Must destroy windows before quitting, otherwise bad things can happen.
|
||||
atom::WindowList* window_list = atom::WindowList::GetInstance();
|
||||
if (window_list->size() == 0) {
|
||||
if (window_list->empty()) {
|
||||
Shutdown();
|
||||
} else {
|
||||
// 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);
|
||||
|
||||
do {
|
||||
if (buffer_.size() == 0)
|
||||
if (buffer_.empty())
|
||||
return;
|
||||
|
||||
// Read the "Content-Length" header.
|
||||
|
|
|
@ -319,7 +319,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
|||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings {
|
||||
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];
|
||||
for (size_t i = 0; i < colors.size(); ++i) {
|
||||
[color_list insertColor:[self colorFromHexColorString:colors[i]]
|
||||
|
|
|
@ -46,7 +46,7 @@ void WindowList::RemoveWindow(NativeWindow* window) {
|
|||
for (WindowListObserver& observer : observers_.Get())
|
||||
observer.OnWindowRemoved(window);
|
||||
|
||||
if (windows.size() == 0) {
|
||||
if (windows.empty()) {
|
||||
for (WindowListObserver& observer : observers_.Get())
|
||||
observer.OnWindowAllClosed();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue