mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fix minor bug and style
This commit is contained in:
parent
5b378a3f01
commit
c6ece40f3c
@ -8,11 +8,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
inline StringRef buildFound(const Pos & pos, const Pos & dot_pos, const Pos & start_of_host)
|
||||
{
|
||||
if (!dot_pos || start_of_host >= pos)
|
||||
if (!dot_pos || start_of_host >= pos || pos - dot_pos == 1)
|
||||
return StringRef{};
|
||||
|
||||
auto after_dot = *(dot_pos + 1);
|
||||
@ -30,10 +31,6 @@ inline StringRef getURLHost(const char * data, size_t size)
|
||||
Pos pos = data;
|
||||
Pos end = data + size;
|
||||
|
||||
if (*(end - 1) == '.')
|
||||
return StringRef{};
|
||||
|
||||
|
||||
Pos slash_pos = find_first_symbols<'/'>(pos, end);
|
||||
if (slash_pos != end)
|
||||
pos = slash_pos;
|
||||
@ -56,7 +53,7 @@ inline StringRef getURLHost(const char * data, size_t size)
|
||||
Pos dot_pos = nullptr;
|
||||
for (; pos < end; ++pos)
|
||||
{
|
||||
switch(*pos)
|
||||
switch (*pos)
|
||||
{
|
||||
case '.':
|
||||
dot_pos = pos;
|
||||
|
Loading…
Reference in New Issue
Block a user