Codebase list golang-github-vbauerster-mpb / 7462da8
bar filler: shorter for loops Vladimir Bauer 2 years ago
1 changed file(s) with 8 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
220220 refWidth := int(internal.PercentageRound(stat.Total, stat.Refill, uint(width)))
221221 curWidth -= refWidth
222222 refWidth += curWidth
223 for curWidth-fillCount >= s.components[iFiller].width {
223 for w := s.components[iFiller].width; curWidth-fillCount >= w; fillCount += w {
224224 filling = append(filling, s.components[iFiller].bytes...)
225 fillCount += s.components[iFiller].width
226 }
227 for refWidth-fillCount >= s.components[iRefiller].width {
225 }
226 for w := s.components[iRefiller].width; refWidth-fillCount >= w; fillCount += w {
228227 refilling = append(refilling, s.components[iRefiller].bytes...)
229 fillCount += s.components[iRefiller].width
230228 }
231229 } else {
232 for curWidth-fillCount >= s.components[iFiller].width {
230 for w := s.components[iFiller].width; curWidth-fillCount >= w; fillCount += w {
233231 filling = append(filling, s.components[iFiller].bytes...)
234 fillCount += s.components[iFiller].width
235 }
236 }
237
238 for width-fillCount >= s.components[iPadding].width {
232 }
233 }
234
235 for w := s.components[iPadding].width; width-fillCount >= w; fillCount += w {
239236 padding = append(padding, s.components[iPadding].bytes...)
240 fillCount += s.components[iPadding].width
241237 }
242238
243239 if width-fillCount != 0 {