Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
f3ec23ac
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f3ec23ac
编写于
12月 18, 2018
作者:
W
wanderingbort
提交者:
GitHub
12月 18, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6501 from EOSIO/feature/port-assign-change
optimization when writing shared_blob data
上级
d0ebb3c4
d02741c0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
12 deletion
+28
-12
libraries/chain/apply_context.cpp
libraries/chain/apply_context.cpp
+2
-4
libraries/chain/eosio_contract.cpp
libraries/chain/eosio_contract.cpp
+10
-7
libraries/chain/include/eosio/chain/types.hpp
libraries/chain/include/eosio/chain/types.hpp
+16
-1
未找到文件。
libraries/chain/apply_context.cpp
浏览文件 @
f3ec23ac
...
...
@@ -521,9 +521,8 @@ int apply_context::db_store_i64( uint64_t code, uint64_t scope, uint64_t table,
const
auto
&
obj
=
db
.
create
<
key_value_object
>
(
[
&
](
auto
&
o
)
{
o
.
t_id
=
tableid
;
o
.
primary_key
=
id
;
o
.
value
.
resize
(
buffer_size
);
o
.
value
.
assign
(
buffer
,
buffer_size
);
o
.
payer
=
payer
;
memcpy
(
o
.
value
.
data
(),
buffer
,
buffer_size
);
});
db
.
modify
(
tab
,
[
&
](
auto
&
t
)
{
...
...
@@ -562,8 +561,7 @@ void apply_context::db_update_i64( int iterator, account_name payer, const char*
}
db
.
modify
(
obj
,
[
&
](
auto
&
o
)
{
o
.
value
.
resize
(
buffer_size
);
memcpy
(
o
.
value
.
data
(),
buffer
,
buffer_size
);
o
.
value
.
assign
(
buffer
,
buffer_size
);
o
.
payer
=
payer
;
});
}
...
...
libraries/chain/eosio_contract.cpp
浏览文件 @
f3ec23ac
...
...
@@ -155,10 +155,11 @@ void apply_eosio_setcode(apply_context& context) {
// TODO: update setcode message to include the hash, then validate it in validate
a
.
last_code_update
=
context
.
control
.
pending_block_time
();
a
.
code_version
=
code_id
;
a
.
code
.
resize
(
code_size
);
if
(
code_size
>
0
)
memcpy
(
a
.
code
.
data
(),
act
.
code
.
data
(),
code_size
);
if
(
code_size
>
0
)
{
a
.
code
.
assign
(
act
.
code
.
data
(),
code_size
);
}
else
{
a
.
code
.
resize
(
0
);
}
});
const
auto
&
account_sequence
=
db
.
get
<
account_sequence_object
,
by_name
>
(
act
.
account
);
...
...
@@ -185,9 +186,11 @@ void apply_eosio_setabi(apply_context& context) {
int64_t
new_size
=
abi_size
;
db
.
modify
(
account
,
[
&
](
auto
&
a
)
{
a
.
abi
.
resize
(
abi_size
);
if
(
abi_size
>
0
)
memcpy
(
a
.
abi
.
data
(),
act
.
abi
.
data
(),
abi_size
);
if
(
abi_size
>
0
)
{
a
.
abi
.
assign
(
act
.
abi
.
data
(),
abi_size
);
}
else
{
a
.
abi
.
resize
(
0
);
}
});
const
auto
&
account_sequence
=
db
.
get
<
account_sequence_object
,
by_name
>
(
act
.
account
);
...
...
libraries/chain/include/eosio/chain/types.hpp
浏览文件 @
f3ec23ac
...
...
@@ -103,7 +103,22 @@ namespace eosio { namespace chain {
*/
class
shared_blob
:
public
shared_string
{
public:
shared_blob
()
=
default
;
shared_blob
()
=
delete
;
shared_blob
(
shared_blob
&&
)
=
default
;
shared_blob
(
const
shared_blob
&
s
)
:
shared_string
(
s
.
get_allocator
())
{
assign
(
s
.
c_str
(),
s
.
size
());
}
shared_blob
&
operator
=
(
const
shared_blob
&
s
)
{
assign
(
s
.
c_str
(),
s
.
size
());
return
*
this
;
}
shared_blob
&
operator
=
(
shared_blob
&&
)
=
default
;
template
<
typename
InputIterator
>
shared_blob
(
InputIterator
f
,
InputIterator
l
,
const
allocator_type
&
a
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录