Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
877be113
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
877be113
编写于
1月 26, 2021
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove useless code, part 2
上级
5f13fddd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
66 deletion
+6
-66
src/Core/BigInt.h
src/Core/BigInt.h
+0
-36
src/IO/ReadHelpers.h
src/IO/ReadHelpers.h
+3
-15
src/IO/WriteHelpers.h
src/IO/WriteHelpers.h
+3
-15
未找到文件。
src/Core/BigInt.h
已删除
100644 → 0
浏览文件 @
5f13fddd
#pragma once
#include <common/StringRef.h>
#include <common/unaligned.h>
#include <Core/Types.h>
namespace
DB
{
template
<
typename
T
>
struct
BigInt
{
static_assert
(
sizeof
(
T
)
==
32
);
static
constexpr
size_t
size
=
32
;
static
StringRef
serialize
(
const
T
&
x
,
char
*
pos
)
{
unalignedStore
<
T
>
(
pos
,
x
);
return
StringRef
(
pos
,
size
);
}
static
String
serialize
(
const
T
&
x
)
{
String
str
(
size
,
'\0'
);
serialize
(
x
,
str
.
data
());
return
str
;
}
static
T
deserialize
(
const
char
*
pos
)
{
return
unalignedLoad
<
T
>
(
pos
);
}
};
}
src/IO/ReadHelpers.h
浏览文件 @
877be113
...
...
@@ -17,7 +17,6 @@
#include <Core/Types.h>
#include <Core/DecimalFunctions.h>
#include <Core/UUID.h>
#include <Core/BigInt.h>
#include <Common/Exception.h>
#include <Common/StringUtils/StringUtils.h>
...
...
@@ -121,17 +120,6 @@ inline void readFloatBinary(T & x, ReadBuffer & buf)
readPODBinary
(
x
,
buf
);
}
template
<
typename
T
>
void
readBigIntBinary
(
T
&
x
,
ReadBuffer
&
buf
)
{
static
const
constexpr
size_t
bytesize
=
BigInt
<
T
>::
size
;
char
bytes
[
bytesize
];
buf
.
readStrict
(
bytes
,
bytesize
);
x
=
BigInt
<
T
>::
deserialize
(
bytes
);
}
inline
void
readStringBinary
(
std
::
string
&
s
,
ReadBuffer
&
buf
,
size_t
MAX_STRING_SIZE
=
DEFAULT_MAX_STRING_SIZE
)
{
size_t
size
=
0
;
...
...
@@ -849,11 +837,11 @@ inline void readBinary(DummyUInt256 & x, ReadBuffer & buf) { readPODBinary(x, bu
inline
void
readBinary
(
Decimal32
&
x
,
ReadBuffer
&
buf
)
{
readPODBinary
(
x
,
buf
);
}
inline
void
readBinary
(
Decimal64
&
x
,
ReadBuffer
&
buf
)
{
readPODBinary
(
x
,
buf
);
}
inline
void
readBinary
(
Decimal128
&
x
,
ReadBuffer
&
buf
)
{
readPODBinary
(
x
,
buf
);
}
inline
void
readBinary
(
Decimal256
&
x
,
ReadBuffer
&
buf
)
{
read
BigInt
Binary
(
x
.
value
,
buf
);
}
inline
void
readBinary
(
Decimal256
&
x
,
ReadBuffer
&
buf
)
{
read
POD
Binary
(
x
.
value
,
buf
);
}
inline
void
readBinary
(
LocalDate
&
x
,
ReadBuffer
&
buf
)
{
readPODBinary
(
x
,
buf
);
}
inline
void
readBinary
(
UInt256
&
x
,
ReadBuffer
&
buf
)
{
read
BigInt
Binary
(
x
,
buf
);
}
inline
void
readBinary
(
Int256
&
x
,
ReadBuffer
&
buf
)
{
read
BigInt
Binary
(
x
,
buf
);
}
inline
void
readBinary
(
UInt256
&
x
,
ReadBuffer
&
buf
)
{
read
POD
Binary
(
x
,
buf
);
}
inline
void
readBinary
(
Int256
&
x
,
ReadBuffer
&
buf
)
{
read
POD
Binary
(
x
,
buf
);
}
template
<
typename
T
>
inline
std
::
enable_if_t
<
is_arithmetic_v
<
T
>
&&
(
sizeof
(
T
)
<=
8
),
void
>
...
...
src/IO/WriteHelpers.h
浏览文件 @
877be113
...
...
@@ -16,7 +16,6 @@
#include <Core/DecimalFunctions.h>
#include <Core/Types.h>
#include <Core/UUID.h>
#include <Core/BigInt.h>
#include <Common/Exception.h>
#include <Common/StringUtils/StringUtils.h>
...
...
@@ -121,17 +120,6 @@ inline void writeStringBinary(const std::string_view & s, WriteBuffer & buf)
writeStringBinary
(
StringRef
{
s
},
buf
);
}
template
<
typename
T
>
void
writeBigIntBinary
(
const
T
&
x
,
WriteBuffer
&
buf
)
{
static
const
constexpr
size_t
bytesize
=
BigInt
<
T
>::
size
;
char
bytes
[
bytesize
];
BigInt
<
T
>::
serialize
(
x
,
bytes
);
buf
.
write
(
bytes
,
bytesize
);
}
template
<
typename
T
>
void
writeVectorBinary
(
const
std
::
vector
<
T
>
&
v
,
WriteBuffer
&
buf
)
{
...
...
@@ -926,12 +914,12 @@ inline void writeBinary(const DummyUInt256 & x, WriteBuffer & buf) { writePODBin
inline
void
writeBinary
(
const
Decimal32
&
x
,
WriteBuffer
&
buf
)
{
writePODBinary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
Decimal64
&
x
,
WriteBuffer
&
buf
)
{
writePODBinary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
Decimal128
&
x
,
WriteBuffer
&
buf
)
{
writePODBinary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
Decimal256
&
x
,
WriteBuffer
&
buf
)
{
write
BigInt
Binary
(
x
.
value
,
buf
);
}
inline
void
writeBinary
(
const
Decimal256
&
x
,
WriteBuffer
&
buf
)
{
write
POD
Binary
(
x
.
value
,
buf
);
}
inline
void
writeBinary
(
const
LocalDate
&
x
,
WriteBuffer
&
buf
)
{
writePODBinary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
LocalDateTime
&
x
,
WriteBuffer
&
buf
)
{
writePODBinary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
UInt256
&
x
,
WriteBuffer
&
buf
)
{
write
BigInt
Binary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
Int256
&
x
,
WriteBuffer
&
buf
)
{
write
BigInt
Binary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
UInt256
&
x
,
WriteBuffer
&
buf
)
{
write
POD
Binary
(
x
,
buf
);
}
inline
void
writeBinary
(
const
Int256
&
x
,
WriteBuffer
&
buf
)
{
write
POD
Binary
(
x
,
buf
);
}
/// Methods for outputting the value in text form for a tab-separated format.
template
<
typename
T
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录