mirror of
https://github.com/walles/moar.git
synced 2024-12-03 06:02:36 +03:00
Move code outside of a lock
This commit is contained in:
parent
7a66c633ca
commit
9af12f451c
@ -140,14 +140,15 @@ func readStream(stream io.Reader, reader *Reader, fromFilter *exec.Cmd) {
|
||||
break
|
||||
}
|
||||
|
||||
newLineString := string(completeLine)
|
||||
newLine := NewLine(newLineString)
|
||||
|
||||
reader.lock.Lock()
|
||||
if reader.replaced {
|
||||
// Somebody called setText(), never mind reading the rest of this stream
|
||||
reader.lock.Unlock()
|
||||
break
|
||||
}
|
||||
newLineString := string(completeLine)
|
||||
newLine := NewLine(newLineString)
|
||||
reader.lines = append(reader.lines, newLine)
|
||||
reader.lock.Unlock()
|
||||
completeLine = completeLine[:0]
|
||||
|
Loading…
Reference in New Issue
Block a user