Codebase list golang-github-vbauerster-mpb / 435ac1b
Mark heapUpdated, when bar is removed Vladimir Bauer 8 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
208208 close(trs.bar.shutdown)
209209 }
210210 if r.toRemove {
211 heap.Remove(s.bHeap, trs.bar.index)
211 s.heapUpdated = heap.Remove(s.bHeap, trs.bar.index) != nil
212212 }
213213 }
214214
236236 }
237237
238238 func calcMax(slice []int) int {
239 if len(slice) == 0 {
240 return 0
241 }
242
239243 max := slice[0]
240
241244 for i := 1; i < len(slice); i++ {
242245 if slice[i] > max {
243246 max = slice[i]
244247 }
245248 }
246
247249 return max
248250 }