@@ -29,7 +29,7 @@ namespace {
29
29
// as 8 bytes.
30
30
StatusOr<std::uint64_t > ParseHexBlock (absl::string_view& str,
31
31
absl::string_view original_str) {
32
- constexpr int kMaxUuidNumberOfHexDigits = 32 ;
32
+ constexpr int kUuidNumberOfHexDigits = 32 ;
33
33
constexpr int kMaxUuidBlockLength = 16 ;
34
34
static auto const * char_to_hex = new std::unordered_map<char , std::uint8_t >(
35
35
{{' 0' , 0x00 }, {' 1' , 0x01 }, {' 2' , 0x02 }, {' 3' , 0x03 }, {' 4' , 0x04 },
@@ -43,7 +43,7 @@ StatusOr<std::uint64_t> ParseHexBlock(absl::string_view& str,
43
43
if (str.empty ()) {
44
44
return internal::InvalidArgumentError (
45
45
absl::StrFormat (" UUID must contain %d hexadecimal digits: %s" ,
46
- kMaxUuidNumberOfHexDigits , original_str),
46
+ kUuidNumberOfHexDigits , original_str),
47
47
GCP_ERROR_INFO ());
48
48
}
49
49
auto it = char_to_hex->find (str[0 ]);
@@ -112,11 +112,6 @@ Uuid::operator std::string() const {
112
112
}
113
113
114
114
StatusOr<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
115
std::string original_str = std::string (str);
121
116
// Check and remove optional braces
122
117
if (absl::ConsumePrefix (&str, " {" )) {
0 commit comments