From 723166ec50a4ed29433bba79cfd02223347e9c59 Mon Sep 17 00:00:00 2001 From: Saxon Date: Tue, 7 Jan 2020 14:45:25 +1030 Subject: [PATCH] codec/mjpeg/jpeg.go: simplified copy --- codec/mjpeg/jpeg.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/codec/mjpeg/jpeg.go b/codec/mjpeg/jpeg.go index cfe0c17a..4d127bfc 100644 --- a/codec/mjpeg/jpeg.go +++ b/codec/mjpeg/jpeg.go @@ -280,9 +280,7 @@ func (c *Context) ParsePayload(p []byte, m bool) error { // Write frame data rem := len(p) - f := p[idx:rem] - copy(c.buf[c.blen:], f) - c.blen += len(f) + c.blen += copy(c.buf[c.blen:], p[idx:rem]) idx += rem if m {