Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Lazily load object index. #333

Merged
merged 1 commit into from
Apr 6, 2017
Merged

Lazily load object index. #333

merged 1 commit into from
Apr 6, 2017

Conversation

taralx
Copy link
Contributor

@taralx taralx commented Apr 6, 2017

fixes #327

Now with passing tests.

packs, err := s.dir.ObjectPacks()
if err != nil {
return err
}

for _, h := range packs {
if err := s.loadIdxFile(h); err != nil {
idxfile, err := s.dir.ObjectPackIdx(h)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this to a function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? I moved it out of the function since it was a fairly straightforward piece of code...

Copy link
Contributor

Choose a reason for hiding this comment

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

because with this you can hide some complexity in this function, also this will help to simplify the code, putting the close in a defer, and inline err check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@codecov
Copy link

codecov bot commented Apr 6, 2017

Codecov Report

Merging #333 into master will increase coverage by <.01%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #333      +/-   ##
==========================================
+ Coverage   77.36%   77.37%   +<.01%     
==========================================
  Files         117      117              
  Lines        8019     8133     +114     
==========================================
+ Hits         6204     6293      +89     
- Misses       1156     1164       +8     
- Partials      659      676      +17
Impacted Files Coverage Δ
storage/filesystem/object.go 72.1% <57.14%> (+4.72%) ⬆️
_examples/common.go 30% <0%> (+6.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c34356d...6ed3f8c. Read the comment docs.

@mcuadros mcuadros merged commit 48dec88 into src-d:master Apr 6, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open scans object index even if not required
2 participants