mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Improve overall performance (#6699)
* Improve overall performance * Clean up code Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -353,7 +353,7 @@ fn execute_sandboxed(
|
||||
Memory::new() can't return a Error qed"
|
||||
),
|
||||
};
|
||||
env_builder.add_memory("env", "memory", memory.clone());
|
||||
env_builder.add_memory("env", "memory", memory);
|
||||
env_builder
|
||||
};
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ impl<D: NativeExecutionDispatch + 'static> CodeExecutor for NativeExecutor<D> {
|
||||
let res = with_externalities_safe(&mut **ext, move || (call)())
|
||||
.and_then(|r| r
|
||||
.map(NativeOrEncoded::Native)
|
||||
.map_err(|s| Error::ApiError(s.to_string()))
|
||||
.map_err(|s| Error::ApiError(s))
|
||||
);
|
||||
|
||||
Ok(res)
|
||||
|
||||
@@ -234,7 +234,6 @@ impl<'a> Sandbox for FunctionExecutor<'a> {
|
||||
table.get(dispatch_thunk_id)
|
||||
.map_err(|_| "dispatch_thunk_idx is out of the table bounds")?
|
||||
.ok_or_else(|| "dispatch_thunk_idx points on an empty table entry")?
|
||||
.clone()
|
||||
};
|
||||
|
||||
let guest_env = match sandbox::GuestEnvironment::decode(&self.sandbox_store, raw_env_def) {
|
||||
|
||||
Reference in New Issue
Block a user