Skip to content

Commit

Permalink
No-op rename: remove metered from metered_scan_slice_of_slices (#…
Browse files Browse the repository at this point in the history
…1058)

* No-op rename: remove `metered` from `metered_scan_slice_of_slices` as there is no metering.

This doesn't seem to need to be metered.

* Remove redundant TODO comment
  • Loading branch information
dmkozh authored Sep 14, 2023
1 parent 25f7a66 commit 1eadaec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
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

0 comments on commit 1eadaec

Please sign in to comment.