diff --git a/SystemTools.cxx b/SystemTools.cxx
index 8c82ec17b54b6ca4f8bd8142065889243c9bba66..65b7b26b5b5c7947b8a1a2237390a039d34151e3 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -3331,7 +3331,7 @@ std::string SystemTools::CollapseFullPath(const std::string& in_path,
   SystemTools::SplitPath(in_path, path_components);
 
   // If the input path is relative, start with a base path.
-  if (path_components[0].length() == 0) {
+  if (path_components[0].empty()) {
     std::vector<std::string> base_components;
     if (in_base) {
       // Use the given base path.