Skip to content

Commit 00693ba

Browse files
committed
Replace "size()" with "empty()".
1 parent 6ef3be2 commit 00693ba

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

atom/app/atom_content_client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
4444

4545
std::vector<std::string> flash_version_numbers = base::SplitString(
4646
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
47-
if (flash_version_numbers.size() < 1)
47+
if (flash_version_numbers.empty())
4848
flash_version_numbers.push_back("11");
4949
// |SplitString()| puts in an empty string given an empty string. :(
5050
else if (flash_version_numbers[0].empty())

atom/browser/api/atom_api_app.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ void OnClientCertificateSelected(
427427

428428
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
429429
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
430-
if (certs.size() > 0)
430+
if (!certs.empty())
431431
delegate->ContinueWithCertificate(certs[0].get());
432432
}
433433

atom/browser/api/atom_api_auto_updater.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
8888
void AutoUpdater::QuitAndInstall() {
8989
// If we don't have any window then quitAndInstall immediately.
9090
WindowList* window_list = WindowList::GetInstance();
91-
if (window_list->size() == 0) {
91+
if (window_list->empty()) {
9292
auto_updater::AutoUpdater::QuitAndInstall();
9393
return;
9494
}

atom/browser/browser.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void Browser::Quit() {
4444
return;
4545

4646
atom::WindowList* window_list = atom::WindowList::GetInstance();
47-
if (window_list->size() == 0)
47+
if (window_list->empty())
4848
NotifyAndShutdown();
4949

5050
window_list->CloseAllWindows();
@@ -66,7 +66,7 @@ void Browser::Exit(mate::Arguments* args) {
6666

6767
// Must destroy windows before quitting, otherwise bad things can happen.
6868
atom::WindowList* window_list = atom::WindowList::GetInstance();
69-
if (window_list->size() == 0) {
69+
if (window_list->empty()) {
7070
Shutdown();
7171
} else {
7272
// Unlike Quit(), we do not ask to close window, but destroy the window

atom/browser/node_debugger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void NodeDebugger::DidRead(net::test_server::StreamListenSocket* socket,
164164
buffer_.append(data, len);
165165

166166
do {
167-
if (buffer_.size() == 0)
167+
if (buffer_.empty())
168168
return;
169169

170170
// Read the "Content-Length" header.

atom/browser/ui/cocoa/atom_touch_bar.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ - (NSTouchBarItem*)makeColorPickerForID:(NSString*)id
319319
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
320320
withSettings:(const mate::PersistentDictionary&)settings {
321321
std::vector<std::string> colors;
322-
if (settings.Get("availableColors", &colors) && colors.size() > 0) {
322+
if (settings.Get("availableColors", &colors) && !colors.empty()) {
323323
NSColorList* color_list = [[[NSColorList alloc] initWithName:@""] autorelease];
324324
for (size_t i = 0; i < colors.size(); ++i) {
325325
[color_list insertColor:[self colorFromHexColorString:colors[i]]

atom/browser/window_list.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void WindowList::RemoveWindow(NativeWindow* window) {
4646
for (WindowListObserver& observer : observers_.Get())
4747
observer.OnWindowRemoved(window);
4848

49-
if (windows.size() == 0) {
49+
if (windows.empty()) {
5050
for (WindowListObserver& observer : observers_.Get())
5151
observer.OnWindowAllClosed();
5252
}

0 commit comments

Comments
 (0)