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

What is srcF for in extractTi ? #3

Open
zhiqiangxu opened this issue Nov 19, 2018 · 0 comments
Open

What is srcF for in extractTi ? #3

zhiqiangxu opened this issue Nov 19, 2018 · 0 comments

Comments

@zhiqiangxu
Copy link

I don't see what os.Open and srcF.Close are for, are these really necessary?

func (bkd *BkdTree) extractTi(dstF *os.File, idx int) (err error) {
    if bkd.trees[idx].meta.NumPoints <= 0 {
        return
    }
    srcF, err := os.Open(bkd.TiPath(idx))
    if err != nil {
        err = errors.Wrap(err, "")
        return
    }
    defer srcF.Close()

    //depth-first extracting from the root node
    meta := &bkd.trees[idx].meta
    err = bkd.extractNode(dstF, bkd.trees[idx].data, meta, int(meta.RootOff))
    return
}
@zhiqiangxu zhiqiangxu changed the title What srcF in the code snippet is for? What srcF in extractTi is for? Nov 19, 2018
@zhiqiangxu zhiqiangxu changed the title What srcF in extractTi is for? What is srcF for in extractTi ? Nov 19, 2018
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

No branches or pull requests

1 participant