diff --git a/lib/tokenize.h b/lib/tokenize.h index fbf51ff12..2058ba49b 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -52,7 +52,7 @@ public: bool isJavaOrCSharp() const { if (_files.size() != 1) return false; - const std::string::size_type pos = _files[0].rfind("."); + const std::string::size_type pos = _files[0].rfind('.'); if (pos != std::string::npos) return (_files[0].substr(pos) == ".java" || _files[0].substr(pos) == ".cs"); @@ -61,9 +61,9 @@ public: /** Is the code C. Used for bailouts */ bool isC() const { - if (_files.size() != 1) + if (_files.empty()) return false; - const std::string::size_type pos = _files[0].rfind("."); + const std::string::size_type pos = _files[0].rfind('.'); if (pos != std::string::npos) return (_files[0].substr(pos) == ".c") || (_files[0].substr(pos) == ".C"); return false; @@ -71,7 +71,7 @@ public: /** Is the code CPP. Used for bailouts */ bool isCPP() const { - return !isJavaOrCSharp() && !isC(); + return !isC() && !isJavaOrCSharp(); } /**