Avoid unnecessary conversions

No need to convert these types.
This commit is contained in:
Christian Muehlhaeuser 2019-08-05 16:42:02 +00:00
parent e590962f2e
commit aeff57c379
1 changed files with 4 additions and 4 deletions

View File

@ -95,11 +95,11 @@ func (d *ResponseDecoder) Decode() (*Response, error) {
startByte := startByteSlice[0] startByte := startByteSlice[0]
// check if attributes are completed // check if attributes are completed
if uint8(startByte) == TagEnd { if startByte == TagEnd {
break break
} }
if uint8(startByte) == TagOperation { if startByte == TagOperation {
if len(tempAttributes) > 0 && tag != TagCupsInvalid { if len(tempAttributes) > 0 && tag != TagCupsInvalid {
appendAttribute(resp, tag, tempAttributes) appendAttribute(resp, tag, tempAttributes)
tempAttributes = make(Attributes) tempAttributes = make(Attributes)
@ -109,7 +109,7 @@ func (d *ResponseDecoder) Decode() (*Response, error) {
tagSet = true tagSet = true
} }
if uint8(startByte) == TagJob { if startByte == TagJob {
if len(tempAttributes) > 0 && tag != TagCupsInvalid { if len(tempAttributes) > 0 && tag != TagCupsInvalid {
appendAttribute(resp, tag, tempAttributes) appendAttribute(resp, tag, tempAttributes)
tempAttributes = make(Attributes) tempAttributes = make(Attributes)
@ -119,7 +119,7 @@ func (d *ResponseDecoder) Decode() (*Response, error) {
tagSet = true tagSet = true
} }
if uint8(startByte) == TagPrinter { if startByte == TagPrinter {
if len(tempAttributes) > 0 && tag != TagCupsInvalid { if len(tempAttributes) > 0 && tag != TagCupsInvalid {
appendAttribute(resp, tag, tempAttributes) appendAttribute(resp, tag, tempAttributes)
tempAttributes = make(Attributes) tempAttributes = make(Attributes)