Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
b949cc23
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,发现更多精彩内容 >>
提交
b949cc23
编写于
9月 24, 2019
作者:
A
Alexander Kuzmenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mark lookupResultGetKey/Mapped functions ALWAYS_INLINE.
They only do pointer arithmetics, so it makes sense to always inline them.
上级
f3bde19b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
26 addition
and
16 deletion
+26
-16
dbms/src/Common/HashTable/ClearableHashMap.h
dbms/src/Common/HashTable/ClearableHashMap.h
+2
-2
dbms/src/Common/HashTable/ClearableHashSet.h
dbms/src/Common/HashTable/ClearableHashSet.h
+2
-2
dbms/src/Common/HashTable/FixedHashMap.h
dbms/src/Common/HashTable/FixedHashMap.h
+4
-2
dbms/src/Common/HashTable/HashMap.h
dbms/src/Common/HashTable/HashMap.h
+8
-4
dbms/src/Common/HashTable/HashSet.h
dbms/src/Common/HashTable/HashSet.h
+4
-2
dbms/src/Common/HashTable/HashTable.h
dbms/src/Common/HashTable/HashTable.h
+6
-4
未找到文件。
dbms/src/Common/HashTable/ClearableHashMap.h
浏览文件 @
b949cc23
...
...
@@ -15,10 +15,10 @@ struct ClearableHashMapCell : public ClearableHashTableCell<Key, HashMapCell<Key
};
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
>
auto
lookupResultGetKey
(
ClearableHashMapCell
<
Key
,
Mapped
,
Hash
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
ClearableHashMapCell
<
Key
,
Mapped
,
Hash
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
>
auto
lookupResultGetMapped
(
ClearableHashMapCell
<
Key
,
Mapped
,
Hash
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
ClearableHashMapCell
<
Key
,
Mapped
,
Hash
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
template
<
...
...
dbms/src/Common/HashTable/ClearableHashSet.h
浏览文件 @
b949cc23
...
...
@@ -49,10 +49,10 @@ struct ClearableHashTableCell : public BaseCell
};
template
<
typename
Key
,
typename
BaseCell
>
auto
lookupResultGetKey
(
ClearableHashTableCell
<
Key
,
BaseCell
>
*
cell
)
{
return
&
cell
->
key
;
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
ClearableHashTableCell
<
Key
,
BaseCell
>
*
cell
)
{
return
&
cell
->
key
;
}
template
<
typename
Key
,
typename
BaseCell
>
void
*
lookupResultGetMapped
(
ClearableHashTableCell
<
Key
,
BaseCell
>
*
)
{
return
nullptr
;
}
ALWAYS_INLINE
inline
void
*
lookupResultGetMapped
(
ClearableHashTableCell
<
Key
,
BaseCell
>
*
)
{
return
nullptr
;
}
template
<
...
...
dbms/src/Common/HashTable/FixedHashMap.h
浏览文件 @
b949cc23
...
...
@@ -48,10 +48,12 @@ struct FixedHashMapCell
};
template
<
typename
Key
,
typename
Mapped
,
typename
State
>
void
*
lookupResultGetKey
(
FixedHashMapCell
<
Key
,
Mapped
,
State
>
*
)
{
return
nullptr
;
}
ALWAYS_INLINE
inline
void
*
lookupResultGetKey
(
FixedHashMapCell
<
Key
,
Mapped
,
State
>
*
)
{
return
nullptr
;
}
template
<
typename
Key
,
typename
Mapped
,
typename
State
>
auto
lookupResultGetMapped
(
FixedHashMapCell
<
Key
,
Mapped
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
FixedHashMapCell
<
Key
,
Mapped
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
template
<
typename
Key
,
typename
Mapped
,
typename
Allocator
=
HashTableAllocator
>
class
FixedHashMap
:
public
FixedHashTable
<
Key
,
FixedHashMapCell
<
Key
,
Mapped
>
,
Allocator
>
...
...
dbms/src/Common/HashTable/HashMap.h
浏览文件 @
b949cc23
...
...
@@ -111,10 +111,12 @@ struct HashMapCell
};
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
,
typename
State
>
auto
lookupResultGetKey
(
HashMapCell
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
HashMapCell
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
,
typename
State
>
auto
lookupResultGetMapped
(
HashMapCell
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
HashMapCell
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
template
<
typename
Key
,
typename
TMapped
,
typename
Hash
,
typename
TState
=
HashTableNoState
>
...
...
@@ -135,10 +137,12 @@ struct HashMapCellWithSavedHash : public HashMapCell<Key, TMapped, Hash, TState>
};
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
,
typename
State
>
auto
lookupResultGetKey
(
HashMapCellWithSavedHash
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
HashMapCellWithSavedHash
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getFirst
();
}
template
<
typename
Key
,
typename
Mapped
,
typename
Hash
,
typename
State
>
auto
lookupResultGetMapped
(
HashMapCellWithSavedHash
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
HashMapCellWithSavedHash
<
Key
,
Mapped
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
getSecond
();
}
template
<
...
...
dbms/src/Common/HashTable/HashSet.h
浏览文件 @
b949cc23
...
...
@@ -85,10 +85,12 @@ struct HashSetCellWithSavedHash : public HashTableCell<Key, Hash, TState>
};
template
<
typename
Key
,
typename
Hash
,
typename
State
>
auto
lookupResultGetKey
(
HashSetCellWithSavedHash
<
Key
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
key
;
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
HashSetCellWithSavedHash
<
Key
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
key
;
}
template
<
typename
Key
,
typename
Hash
,
typename
State
>
void
*
lookupResultGetMapped
(
HashSetCellWithSavedHash
<
Key
,
Hash
,
State
>
*
)
{
return
nullptr
;
}
ALWAYS_INLINE
inline
void
*
lookupResultGetMapped
(
HashSetCellWithSavedHash
<
Key
,
Hash
,
State
>
*
)
{
return
nullptr
;
}
template
<
...
...
dbms/src/Common/HashTable/HashTable.h
浏览文件 @
b949cc23
...
...
@@ -124,7 +124,7 @@ void set(T & x) { x = 0; }
* The default implementation of GetMapped that is used for the above case (2).
*/
template
<
typename
PointerLike
>
inline
auto
lookupResultGetMapped
(
PointerLike
&&
ptr
)
{
return
&*
ptr
;
}
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
PointerLike
&&
ptr
)
{
return
&*
ptr
;
}
/**
* Generic const wrapper for lookupResultGetMapped, that calls a non-const
...
...
@@ -132,7 +132,7 @@ inline auto lookupResultGetMapped(PointerLike && ptr) { return &*ptr; }
* arithmetics.
*/
template
<
typename
T
>
auto
lookupResultGetMapped
(
const
T
*
obj
)
ALWAYS_INLINE
inline
auto
lookupResultGetMapped
(
const
T
*
obj
)
{
auto
mapped_ptr
=
lookupResultGetMapped
(
const_cast
<
T
*>
(
obj
));
const
auto
const_mapped_ptr
=
mapped_ptr
;
...
...
@@ -208,10 +208,12 @@ struct HashTableCell
};
template
<
typename
Key
,
typename
Hash
,
typename
State
>
auto
lookupResultGetKey
(
HashTableCell
<
Key
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
key
;
}
ALWAYS_INLINE
inline
auto
lookupResultGetKey
(
HashTableCell
<
Key
,
Hash
,
State
>
*
cell
)
{
return
&
cell
->
key
;
}
template
<
typename
Key
,
typename
Hash
,
typename
State
>
void
*
lookupResultGetMapped
(
HashTableCell
<
Key
,
Hash
,
State
>
*
)
{
return
nullptr
;
}
ALWAYS_INLINE
inline
void
*
lookupResultGetMapped
(
HashTableCell
<
Key
,
Hash
,
State
>
*
)
{
return
nullptr
;
}
/**
* A helper function for HashTable::insert() to set the "mapped" value.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录