mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 10:22:19 +00:00
Grow buffer each time
This commit is contained in:
parent
67ef07cac5
commit
36a890a914
@ -143,7 +143,6 @@ func StartASCIIArtStream(streamID string, reader io.ReadCloser) {
|
||||
currentMessage[streamID] = new(string)
|
||||
pixelBuff := make([]byte, Cfg.Width*Cfg.Height)
|
||||
textBuff := strings.Builder{}
|
||||
textBuff.Grow((2*Cfg.Width + 1) * Cfg.Height)
|
||||
for {
|
||||
n, err := reader.Read(pixelBuff)
|
||||
if err != nil {
|
||||
@ -157,6 +156,7 @@ func StartASCIIArtStream(streamID string, reader io.ReadCloser) {
|
||||
|
||||
// Header
|
||||
textBuff.Reset()
|
||||
textBuff.Grow((2*Cfg.Width + 1) * Cfg.Height)
|
||||
for i := 0; i < 42; i++ {
|
||||
textBuff.WriteByte('\n')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user