-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
) | ||
.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()) |
There was a problem hiding this comment.
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)?; |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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
Originally from #461 but extracted here for a separate review.
No externally visible changes, only internal readibility improvements.