diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/command_line_unittest.cc | 4 | ||||
-rw-r--r-- | base/file_path.cc | 5 | ||||
-rw-r--r-- | base/process_util_posix.cc | 2 | ||||
-rw-r--r-- | base/string_util.cc | 3 |
4 files changed, 7 insertions, 7 deletions
diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index de8e414..5ce6911 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc @@ -109,9 +109,9 @@ TEST(CommandLineTest, EmptyString) { EXPECT_TRUE(cl.GetProgram().empty()); #elif defined(OS_POSIX) CommandLine cl(0, NULL); - EXPECT_EQ(0U, cl.argv().size()); + EXPECT_TRUE(cl.argv().empty()); #endif - EXPECT_EQ(0U, cl.args().size()); + EXPECT_TRUE(cl.args().empty()); } // Test methods for appending switches to a command line. diff --git a/base/file_path.cc b/base/file_path.cc index 32217f2..29ec7a80 100644 --- a/base/file_path.cc +++ b/base/file_path.cc @@ -249,9 +249,8 @@ bool FilePath::AppendRelativePath(const FilePath& child, GetComponents(&parent_components); child.GetComponents(&child_components); - if (parent_components.size() >= child_components.size()) - return false; - if (parent_components.empty()) + if (parent_components.empty() || + parent_components.size() >= child_components.size()) return false; std::vector<StringType>::const_iterator parent_comp = diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index cf93c05..90c0f96 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -400,7 +400,7 @@ char** AlterEnvironment(const environment_vector& changes, } // if !found, then we have a new element to add. - if (!found && j->second.size() > 0) { + if (!found && !j->second.empty()) { count++; size += j->first.size() + 1 /* '=' */ + j->second.size() + 1 /* NUL */; } diff --git a/base/string_util.cc b/base/string_util.cc index 4af3ed9..af96d91 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -804,7 +804,8 @@ size_t Tokenize(const base::StringPiece& str, template<typename STR> static STR JoinStringT(const std::vector<STR>& parts, typename STR::value_type sep) { - if (parts.empty()) return STR(); + if (parts.empty()) + return STR(); STR result(parts[0]); typename std::vector<STR>::const_iterator iter = parts.begin(); |