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

Market Actor v3 #1010

Merged
merged 16 commits into from
Feb 12, 2021
Merged

Market Actor v3 #1010

merged 16 commits into from
Feb 12, 2021

Conversation

ec2
Copy link
Member

@ec2 ec2 commented Feb 11, 2021

Summary of changes
Changes introduced in this pull request:

  • Its all in the title

Reference issue to close (if applicable)

Closes

Other information and links

vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/mod.rs Outdated Show resolved Hide resolved
vm/actor/src/builtin/market/state.rs Show resolved Hide resolved
vm/actor/src/lib.rs Outdated Show resolved Hide resolved
self.0.delete(key)?;

Ok(())
pub fn delete(&mut self, key: &[u8]) -> Result<Option<()>, Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Option<()> can definitely be simplified to be a bool, can't think of a benefit to having it as an option

Copy link
Member Author

Choose a reason for hiding this comment

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

I like the option because then we can do the method chaining when handling the error instead of checking if its Some(false). What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then what is the need to erase the return in the function? This may lead to having to do unnecessary work if you need to retrieve the value first?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. gunna return the byteskey

Copy link
Member Author

@ec2 ec2 Feb 12, 2021

Choose a reason for hiding this comment

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

Actually... Does that make sense? we should already have the key.... The value of the underlying map is always () because this is a Set that's backed by a hamt

@ec2 ec2 requested a review from austinabell February 11, 2021 20:45
vm/actor/src/lib.rs Outdated Show resolved Hide resolved
self.0.delete(key)?;

Ok(())
pub fn delete(&mut self, key: &[u8]) -> Result<Option<()>, Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Then what is the need to erase the return in the function? This may lead to having to do unnecessary work if you need to retrieve the value first?

@ec2 ec2 merged commit 0289e34 into main Feb 12, 2021
@ec2 ec2 deleted the ec2/market-actor-v3 branch February 12, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants