Skip to content

Ipns/refactor unixfs #865

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

Merged
merged 1 commit into from
Mar 7, 2015
Merged

Ipns/refactor unixfs #865

merged 1 commit into from
Mar 7, 2015

Conversation

whyrusleeping
Copy link
Member

This refactors the unixfs 'MultiBlock' object into a more general 'FSNode' object and adds some methods to the related code making it easier to work with.

This is PR number 2 of the ipns set

@whyrusleeping whyrusleeping added the status/in-progress In progress label Mar 6, 2015
@whyrusleeping whyrusleeping mentioned this pull request Mar 6, 2015
@whyrusleeping whyrusleeping force-pushed the ipns/refactor-unixfs branch from b9f385f to 03c966b Compare March 6, 2015 23:13
@whyrusleeping whyrusleeping force-pushed the ipns/refactor-unixfs branch from 03c966b to 0e9772c Compare March 7, 2015 06:12
// Removes the child node at the given index
func (n *UnixfsNode) RemoveChild(index int) {
n.ufmt.RemoveBlockSize(index)
n.node.Links = append(n.node.Links[:index], n.node.Links[index+1:]...)
Copy link
Member

Choose a reason for hiding this comment

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

should check index is in the right range or this will panic-- maybe that's ok

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 think of it as a normal array access, you wouldnt try doing node.Links[i] if you werent already sure i was in the proper range

Copy link
Member

Choose a reason for hiding this comment

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

👍

@jbenet
Copy link
Member

jbenet commented Mar 7, 2015

LGTM! RTM

jbenet added a commit that referenced this pull request Mar 7, 2015
@jbenet jbenet merged commit d0e69a0 into master Mar 7, 2015
@jbenet jbenet removed the status/in-progress In progress label Mar 7, 2015
@jbenet jbenet deleted the ipns/refactor-unixfs branch March 7, 2015 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants