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

Minor readibility improvements #476

Merged
merged 4 commits into from
Jun 9, 2023
Merged

Minor readibility improvements #476

merged 4 commits into from
Jun 9, 2023

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Jun 6, 2023

Originally from #461 but extracted here for a separate review.
No externally visible changes, only internal readibility improvements.

@Dentosal Dentosal added the fuel-vm Related to the `fuel-vm` crate. label Jun 6, 2023
@Dentosal Dentosal requested a review from a team June 6, 2023 08:08
@Dentosal Dentosal self-assigned this Jun 6, 2023
xgreenx
xgreenx previously approved these changes Jun 8, 2023
)
.checked_add(length as Word)
.ok_or(PanicReason::MemoryOverflow)?;
let length = Word::from_be_bytes(self.memory[fp_code_size..fp_code_size_end].try_into().unwrap())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] It it better to use expect even if we checked it above=)

.and_then(|data| try_mem_write(a as usize, data.as_ref(), owner, memory))?;

let coinbase = storage.coinbase().map_err(RuntimeError::from_io)?;
try_mem_write(a as usize, coinbase.as_ref(), owner, memory)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do we still need a as usize here?

@@ -305,48 +312,17 @@ where
}
.prepare_call()
}

/// Prepare a call instruction for execution
pub fn prepare_call(&mut self, ra: RegId, rb: RegId, rc: RegId, rd: RegId) -> Result<(), RuntimeError> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FInally, someone did that=D Thank you <3

bvrooman
bvrooman previously approved these changes Jun 9, 2023
@xgreenx xgreenx dismissed stale reviews from bvrooman and themself via 0a000ae June 9, 2023 23:13
@xgreenx xgreenx added this pull request to the merge queue Jun 9, 2023
Merged via the queue into master with commit 6e76b6d Jun 9, 2023
@xgreenx xgreenx deleted the dento/readibility-1 branch June 9, 2023 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuel-vm Related to the `fuel-vm` crate.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants