]> Sergey Matveev's repositories - btrtrc.git/blobdiff - piece.go
Simplify PIece.iterUndirtiedChunks
[btrtrc.git] / piece.go
index e1b6ff90aa8a504330da2095e48593c62bd557f6..c79446972c19ae907e156981264f44edc0a72da4 100644 (file)
--- a/piece.go
+++ b/piece.go
@@ -237,14 +237,11 @@ func (p *Piece) State() PieceState {
        return p.t.PieceState(p.index)
 }
 
-func (p *Piece) iterUndirtiedChunks(f func(cs ChunkSpec) bool) bool {
+func (p *Piece) iterUndirtiedChunks(f func(cs ChunkSpec)) {
        for i := pp.Integer(0); i < p.numChunks(); i++ {
                if p.chunkIndexDirty(i) {
                        continue
                }
-               if !f(p.chunkIndexSpec(i)) {
-                       return false
-               }
+               f(p.chunkIndexSpec(i))
        }
-       return true
 }