Skip to content

Commit

Permalink
Fix iteration method
Browse files Browse the repository at this point in the history
  • Loading branch information
irxground committed Jun 14, 2019
1 parent ee18b67 commit 16d85f3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/memory/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ macro_rules! memory_view {
pub fn each(&self) {
let view = self.memory.view::<$wasm_type>();

let mut offset = self.offset;
while offset < view.len() {
let value = view[offset].get();
VM::yield_object(Integer::from(value as i64));
offset += 1;
for nth in self.offset..view.len() {
let value = view[nth].get() as i64;
VM::yield_object(Integer::from(value));
}
}
}
Expand Down

0 comments on commit 16d85f3

Please sign in to comment.