File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -311,12 +311,12 @@ func (th *TlfHistory) recomputeLocked() (
311
311
}
312
312
}
313
313
sort .Sort (history )
314
- // Garbage-collect any writers that don't appear in the history.
315
- for i := maxWritersPerHistory ; i < len (history ); i ++ {
316
- delete (th .byWriter , history [i ].writerName )
317
- delete (writersWhoNeedMore , history [i ].writerName )
318
- }
319
314
if len (history ) > maxWritersPerHistory {
315
+ // Garbage-collect any writers that don't appear in the history.
316
+ for i := maxWritersPerHistory ; i < len (history ); i ++ {
317
+ delete (th .byWriter , history [i ].writerName )
318
+ delete (writersWhoNeedMore , history [i ].writerName )
319
+ }
320
320
history = history [:maxWritersPerHistory ]
321
321
}
322
322
th .computed = true
@@ -328,7 +328,10 @@ func (th *TlfHistory) getHistoryIfCached() (
328
328
cached bool , history writersByRevision ) {
329
329
th .lock .RLock ()
330
330
defer th .lock .RUnlock ()
331
- return th .computed , th .cachedHistory
331
+ if th .computed {
332
+ return true , th .cachedHistory
333
+ }
334
+ return false , nil
332
335
}
333
336
334
337
func (th * TlfHistory ) getHistory () writersByRevision {
You can’t perform that action at this time.
0 commit comments