diff --git a/ortools/base/case.cc b/ortools/base/case.cc index 785206e101..7dd9c72637 100644 --- a/ortools/base/case.cc +++ b/ortools/base/case.cc @@ -13,19 +13,17 @@ // This file contains string processing functions related to // uppercase, lowercase, etc. - #include "ortools/base/case.h" #include #include -//#include "base/port.h" #include "absl/hash/hash.h" #include "absl/strings/ascii.h" #include "absl/strings/match.h" #include "absl/strings/string_view.h" -#ifdef _MSC_VER +#ifdef _MSC_VER #define strncasecmp _strnicmp #define strcasecmp _stricmp #endif @@ -101,7 +99,7 @@ int AsciiCaseInsensitiveCompare(absl::string_view s1, absl::string_view s2) { } size_t AsciiCaseInsensitiveHash::operator()(absl::string_view s) const { - //return absl::HashOf(absl::AsciiStrToLower(s)); + // return absl::HashOf(absl::AsciiStrToLower(s)); return std::hash{}(absl::AsciiStrToLower(s)); } @@ -113,7 +111,7 @@ bool AsciiCaseInsensitiveEq::operator()(absl::string_view s1, void MakeAsciiTitlecase(std::string* s, absl::string_view delimiters) { bool upper = true; - for (auto &ch : *s) { + for (auto& ch : *s) { if (upper) { ch = absl::ascii_toupper(ch); } @@ -127,5 +125,4 @@ std::string MakeAsciiTitlecase(absl::string_view s, MakeAsciiTitlecase(&result, delimiters); return result; } - } // namespace strings diff --git a/ortools/base/case.h b/ortools/base/case.h index aa8cc80f58..ffd548910e 100644 --- a/ortools/base/case.h +++ b/ortools/base/case.h @@ -18,8 +18,6 @@ // Unlike (or absl/strings/ascii.h), the functions in this file // are designed to operate on strings, not single characters. // -// If you need to process UTF8 strings, take a look at files in i18n/utf8. -// // Except for those marked as "using the C/POSIX locale", these functions are // for ASCII strings only. @@ -43,7 +41,6 @@ #include "absl/strings/string_view.h" namespace strings { - // Enum values returned by GetAsciiCapitalization(). enum class AsciiCapitalizationType { kLower, // Entirely lowercase @@ -128,5 +125,4 @@ std::string MakeAsciiTitlecase(absl::string_view s, absl::string_view delimiters); } // namespace strings - #endif // OR_TOOLS_BASE_CASE_H_ diff --git a/ortools/base/container_logging.h b/ortools/base/container_logging.h index d80a92a742..fb33778267 100644 --- a/ortools/base/container_logging.h +++ b/ortools/base/container_logging.h @@ -40,6 +40,7 @@ #include #include +#include "absl/base/port.h" #include "ortools/base/integral_types.h" namespace gtl { diff --git a/ortools/base/int_type.h b/ortools/base/int_type.h index e6af40d989..07d51b9b34 100644 --- a/ortools/base/int_type.h +++ b/ortools/base/int_type.h @@ -151,6 +151,7 @@ #include // NOLINT #include +#include "absl/base/port.h" #include "absl/strings/string_view.h" #include "ortools/base/macros.h" diff --git a/ortools/base/random.cc b/ortools/base/random.cc index 5fc356c6cb..eae1801e3e 100644 --- a/ortools/base/random.cc +++ b/ortools/base/random.cc @@ -11,11 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - -#include -#include -#include - #include "ortools/base/random.h" namespace operations_research { @@ -34,9 +29,7 @@ uint64_t ACMRandom::operator()(uint64_t val_max) { return val_max == 0 ? 0 : Next64() % val_max; } -int32_t ACMRandom::HostnamePidTimeSeed() { - return std::random_device{}(); -} +int32_t ACMRandom::HostnamePidTimeSeed() { return std::random_device{}(); } int32_t ACMRandom::DeterministicSeed() { return 0; }