summaryrefslogtreecommitdiffstats
path: root/chrome/common/unix_domain_socket_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/unix_domain_socket_posix.cc')
-rw-r--r--chrome/common/unix_domain_socket_posix.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/chrome/common/unix_domain_socket_posix.cc b/chrome/common/unix_domain_socket_posix.cc
index 7621b7e..6bd387b 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;
}