codec/mjpeg/jpeg.go: simplified if statement

This commit is contained in:
Saxon 2020-01-02 15:04:16 +10:30
parent c42d58ea85
commit 210d368adb
1 changed files with 3 additions and 5 deletions

View File

@ -223,11 +223,9 @@ func (c *Context) ParsePayload(p []byte, m bool) error {
if qLen > 0 { if qLen > 0 {
qTable = b.getBuf(qLen) qTable = b.getBuf(qLen)
if q < 255 { if q < 255 && c.qTablesLen[q-128] == 0 && qLen <= 128 {
if c.qTablesLen[q-128] == 0 && qLen <= 128 { copy(c.qTables[q-128][:], qTable)
copy(c.qTables[q-128][:], qTable) c.qTablesLen[q-128] = byte(qLen)
c.qTablesLen[q-128] = byte(qLen)
}
} }
} else { } else {
if q == 255 { if q == 255 {