Skip to content

Commit

Permalink
Merge pull request #418 from xushiwei/q
Browse files Browse the repository at this point in the history
cache.Save: skip if not dirty
  • Loading branch information
xushiwei authored Mar 25, 2024
2 parents 38a18eb + 84da482 commit af40cbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ func (p *Impl) loadCachePkgs(lines []string) error {

// Save saves the cache to a file.
func (p *Impl) Save(cacheFile string) (err error) {
if atomic.LoadInt32(&p.nlist) == 0 { // not dirty
return
}
var buf bytes.Buffer
p.cache.Range(func(key, val any) bool {
pkg := val.(*pkgCache)
Expand Down

0 comments on commit af40cbf

Please sign in to comment.