fix style

This commit is contained in:
Yakov Olkhovskiy 2022-11-14 14:46:04 +00:00
parent 9aeebf3bdf
commit 9c53bfdb18
2 changed files with 7 additions and 4 deletions

View File

@ -843,7 +843,8 @@ inline ReturnType readIPv4TextImpl(IPv4 & ip, ReadBuffer & buf)
char s[16]; char s[16];
size_t size = buf.read(s, sizeof(s)); size_t size = buf.read(s, sizeof(s));
auto ret_false = [&]() { auto ret_false = [&]()
{
if constexpr (std::is_same_v<ReturnType, void>) if constexpr (std::is_same_v<ReturnType, void>)
throw ParsingException(std::string("Cannot parse IPv4 ") + s, ErrorCodes::CANNOT_PARSE_IPV4); throw ParsingException(std::string("Cannot parse IPv4 ") + s, ErrorCodes::CANNOT_PARSE_IPV4);
else else
@ -897,7 +898,8 @@ inline ReturnType readIPv6TextImpl(IPv6 & ip, ReadBuffer & buf)
char s[40]; char s[40];
size_t size = buf.read(s, sizeof(s)); size_t size = buf.read(s, sizeof(s));
auto ret_false = [&]() { auto ret_false = [&]()
{
if constexpr (std::is_same_v<ReturnType, void>) if constexpr (std::is_same_v<ReturnType, void>)
throw ParsingException(std::string("Cannot parse IPv6 ") + s, ErrorCodes::CANNOT_PARSE_IPV6); throw ParsingException(std::string("Cannot parse IPv6 ") + s, ErrorCodes::CANNOT_PARSE_IPV6);
else else
@ -909,7 +911,7 @@ inline ReturnType readIPv6TextImpl(IPv6 & ip, ReadBuffer & buf)
if (parseIPv6(s, reinterpret_cast<unsigned char *>(ip.toUnderType().items))) if (parseIPv6(s, reinterpret_cast<unsigned char *>(ip.toUnderType().items)))
return ReturnType(true); return ReturnType(true);
return ret_false(); return ret_false();
} }

View File

@ -41,7 +41,8 @@ void formatUUID(std::reverse_iterator<const UInt8 *> src16, UInt8 * dst36)
namespace detail namespace detail
{ {
template <unsigned... digits> template <unsigned... digits>
struct ToChars { struct ToChars
{
static const char value[]; static const char value[];
static const size_t size; static const size_t size;
}; };