mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
Merge pull request #17963 from nikitamikhaylov/fix-arcadia
Use ryu instead of dragonbox in Arcadia
This commit is contained in:
commit
77df818c5f
@ -29,7 +29,12 @@
|
|||||||
#include <IO/DoubleConverter.h>
|
#include <IO/DoubleConverter.h>
|
||||||
#include <IO/WriteBufferFromString.h>
|
#include <IO/WriteBufferFromString.h>
|
||||||
|
|
||||||
#include <dragonbox/dragonbox_to_chars.h>
|
/// There is no dragonbox in Arcadia
|
||||||
|
#if !defined(ARCADIA_BUILD)
|
||||||
|
# include <dragonbox/dragonbox_to_chars.h>
|
||||||
|
#else
|
||||||
|
# include <ryu/ryu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Formats/FormatSettings.h>
|
#include <Formats/FormatSettings.h>
|
||||||
|
|
||||||
@ -228,14 +233,22 @@ inline size_t writeFloatTextFastPath(T x, char * buffer)
|
|||||||
if (DecomposedFloat64(x).is_inside_int64())
|
if (DecomposedFloat64(x).is_inside_int64())
|
||||||
result = itoa(Int64(x), buffer) - buffer;
|
result = itoa(Int64(x), buffer) - buffer;
|
||||||
else
|
else
|
||||||
|
#if !defined(ARCADIA_BUILD)
|
||||||
result = jkj::dragonbox::to_chars_n(x, buffer) - buffer;
|
result = jkj::dragonbox::to_chars_n(x, buffer) - buffer;
|
||||||
|
#else
|
||||||
|
result = d2s_buffered_n(x, buffer);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (DecomposedFloat32(x).is_inside_int32())
|
if (DecomposedFloat32(x).is_inside_int32())
|
||||||
result = itoa(Int32(x), buffer) - buffer;
|
result = itoa(Int32(x), buffer) - buffer;
|
||||||
else
|
else
|
||||||
|
#if !defined(ARCADIA_BUILD)
|
||||||
result = jkj::dragonbox::to_chars_n(x, buffer) - buffer;
|
result = jkj::dragonbox::to_chars_n(x, buffer) - buffer;
|
||||||
|
#else
|
||||||
|
result = f2s_buffered_n(x, buffer);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result <= 0)
|
if (result <= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user