mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
WriteHelpers: improvement [#CONV-3632].
This commit is contained in:
parent
b595e61c03
commit
9166338e0b
@ -175,7 +175,11 @@ void writeAnyEscapedString(const String & s, WriteBuffer & buf)
|
||||
|
||||
inline void writeEscapedString(const String & s, WriteBuffer & buf)
|
||||
{
|
||||
writeAnyEscapedString<'\''>(s, buf);
|
||||
/// strpbrk хорошо оптимизирована (этот if ускоряет код в 1.5 раза)
|
||||
if (NULL == strpbrk(s.data(), "\b\f\n\r\t\'\\") && strlen(s.data()) == s.size())
|
||||
writeString(s, buf);
|
||||
else
|
||||
writeAnyEscapedString<'\''>(s, buf);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user