Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
add explanation for iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
NikVolf committed Aug 4, 2020
1 parent 7e8fd19 commit 768f4cc
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ impl GlobalsSnapshot {
///
/// This instance must be the same that was used for creation of this snapshot.
pub fn apply(&self, instance_wrapper: &InstanceWrapper) -> Result<()> {
/// This is a pointer over saved items, it moves forward when the loop value below takes over it's current value.
/// Since both pointers (`current` and `index` below) are over ordered lists, they eventually hit all
/// equal referenced values.
let mut current = 0;
for (index, export) in instance_wrapper.instance.exports().enumerate() {
if current >= self.0.len() { break; }
Expand Down

0 comments on commit 768f4cc

Please sign in to comment.