Browse Source

codec: remove superflous comparisons of x <= MaxUint64

This always evaluates to true.

Fixes #79
Ugorji Nwoke 10 years ago
parent
commit
03e33114d4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      codec/cbor.go
  2. 1 1
      codec/simple.go

+ 1 - 1
codec/cbor.go

@@ -98,7 +98,7 @@ func (e *cborEncDriver) encUint(v uint64, bd byte) {
 	} else if v <= math.MaxUint32 {
 		e.w.writen1(bd + 0x1a)
 		bigenHelper{e.x[:4], e.w}.writeUint32(uint32(v))
-	} else if v <= math.MaxUint64 {
+	} else { // if v <= math.MaxUint64 {
 		e.w.writen1(bd + 0x1b)
 		bigenHelper{e.x[:8], e.w}.writeUint64(v)
 	}

+ 1 - 1
codec/simple.go

@@ -77,7 +77,7 @@ func (e *simpleEncDriver) encUint(v uint64, bd uint8) {
 	} else if v <= math.MaxUint32 {
 		e.w.writen1(bd + 2)
 		bigenHelper{e.b[:4], e.w}.writeUint32(uint32(v))
-	} else if v <= math.MaxUint64 {
+	} else { // if v <= math.MaxUint64 {
 		e.w.writen1(bd + 3)
 		bigenHelper{e.b[:8], e.w}.writeUint64(v)
 	}