Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: chrome/common/unix_domain_socket_posix.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/user_script.cc ('k') | chrome/common/web_apps_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/unix_domain_socket_posix.cc
diff --git a/chrome/common/unix_domain_socket_posix.cc b/chrome/common/unix_domain_socket_posix.cc
index 7621b7e654d3cdd992160c57d89a1720c9b4c1ee..6bd387b98105689567040b9a709d57102085050e 100644
--- a/chrome/common/unix_domain_socket_posix.cc
+++ b/chrome/common/unix_domain_socket_posix.cc
@@ -127,7 +127,7 @@ ssize_t UnixDomainSocket::SendRecvMsg(int fd,
if (reply_len == -1)
return -1;
- if ((fd_vector.size() > 0 && result_fd == NULL) || fd_vector.size() > 1) {
+ if ((!fd_vector.empty() && result_fd == NULL) || fd_vector.size() > 1) {
for (std::vector<int>::const_iterator
i = fd_vector.begin(); i != fd_vector.end(); ++i) {
close(*i);
@@ -138,13 +138,8 @@ ssize_t UnixDomainSocket::SendRecvMsg(int fd,
return -1;
}
- if (result_fd) {
- if (fd_vector.empty()) {
- *result_fd = -1;
- } else {
- *result_fd = fd_vector[0];
- }
- }
+ if (result_fd)
+ *result_fd = fd_vector.empty() ? -1 : fd_vector[0];
return reply_len;
}
« no previous file with comments | « chrome/common/extensions/user_script.cc ('k') | chrome/common/web_apps_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698