@@ -29,7 +29,7 @@ namespace {
2929// as 8 bytes.
3030StatusOr<std::uint64_t > ParseHexBlock (absl::string_view& str,
3131 absl::string_view original_str) {
32- constexpr int kMaxUuidNumberOfHexDigits = 32 ;
32+ constexpr int kUuidNumberOfHexDigits = 32 ;
3333 constexpr int kMaxUuidBlockLength = 16 ;
3434 static auto const * char_to_hex = new std::unordered_map<char , std::uint8_t >(
3535 {{' 0' , 0x00 }, {' 1' , 0x01 }, {' 2' , 0x02 }, {' 3' , 0x03 }, {' 4' , 0x04 },
@@ -43,7 +43,7 @@ StatusOr<std::uint64_t> ParseHexBlock(absl::string_view& str,
4343 if (str.empty ()) {
4444 return internal::InvalidArgumentError (
4545 absl::StrFormat (" UUID must contain %d hexadecimal digits: %s" ,
46- kMaxUuidNumberOfHexDigits , original_str),
46+ kUuidNumberOfHexDigits , original_str),
4747 GCP_ERROR_INFO ());
4848 }
4949 auto it = char_to_hex->find (str[0 ]);
@@ -112,12 +112,7 @@ Uuid::operator std::string() const {
112112}
113113
114114StatusOr<Uuid> MakeUuid (absl::string_view str) {
115- if (str.empty ()) {
116- return internal::InvalidArgumentError (
117- absl::StrFormat (" UUID cannot be empty" ), GCP_ERROR_INFO ());
118- }
119-
120- std::string original_str = std::string (str);
115+ absl::string_view original_str = str;
121116 // Check and remove optional braces
122117 if (absl::ConsumePrefix (&str, " {" )) {
123118 if (!absl::ConsumeSuffix (&str, " }" )) {
0 commit comments