-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,7 +138,7 @@ impl Account { | |
| /// get someone who knows to call `note_code`. | ||
| pub fn code(&self) -> Option<&[u8]> { | ||
| match self.code_hash { | ||
| Some(SHA3_EMPTY) | None if self.code_cache.is_empty() => Some(&self.code_cache), | ||
| Some(c) if c == SHA3_EMPTY && self.code_cache.is_empty() => Some(&self.code_cache), | ||
| Some(_) if !self.code_cache.is_empty() => Some(&self.code_cache), | ||
| None => Some(&self.code_cache), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this actually make sense? Before this refactor we were matching None if self.code_cache.is_empty() => Some(&self.code_cache),
None => Some(&self.code_cache),There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it does not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the original code (https://github.com/ethcore/parity/blob/master/ethcore/src/account.rs) was: there are no options here which are superfluous. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code from master already contains this change (was included with #889 - otherwise there was compilation error on nightly). The logic wasn't different, but there was superfluous There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct (technically, the first is actually a logic error and should properly be either asserted against or an error). The second (i.e. there is definitely some non-empty code, but it isn't presently cached) properly returns |
||
| _ => None, | ||
|
|
||
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.
extra space.