Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No-op rename: remove metered from metered_scan_slice_of_slices #1058

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion soroban-env-host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ impl EnvBase for Host {

fn symbol_index_in_strs(&self, sym: Symbol, slices: &[&str]) -> Result<U32Val, Self::Error> {
let mut found = None;
self.metered_scan_slice_of_slices(slices, |i, slice| {
self.scan_slice_of_slices(slices, |i, slice| {
if self.symbol_matches(slice.as_bytes(), sym)? && found.is_none() {
found = Some(i)
}
Expand Down
4 changes: 1 addition & 3 deletions soroban-env-host/src/host/mem_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl Host {
Ok(())
}

pub(crate) fn metered_scan_slice_of_slices(
pub(crate) fn scan_slice_of_slices(
&self,
slices: &[&str],
mut callback: impl FnMut(usize, &str) -> Result<(), HostError>,
Expand Down Expand Up @@ -303,8 +303,6 @@ impl Host {
let obj_end = obj_pos
.checked_add(len)
.ok_or_else(|| self.err_arith_overflow())? as usize;
// TODO: we currently grow the destination vec if it's not big enough,
// make sure this is desirable behaviour.
if obj_new.len() < obj_end {
self.charge_budget(
ContractCostType::HostMemAlloc,
Expand Down