Forráskód Böngészése

use untyped const

Chris Bannister 10 éve
szülő
commit
0fcfe1f0f2
1 módosított fájl, 3 hozzáadás és 9 törlés
  1. 3 9
      marshal.go

+ 3 - 9
marshal.go

@@ -1213,11 +1213,7 @@ func marshalTuple(info TypeInfo, value interface{}) ([]byte, error) {
 			}
 
 			n := len(data)
-			buf = append(buf, byte(n>>24),
-				byte(n>>16),
-				byte(n>>8),
-				byte(n))
-
+			buf = appendInt(buf, int32(n))
 			buf = append(buf, data...)
 		}
 
@@ -1346,13 +1342,11 @@ func marshalUDT(info TypeInfo, value interface{}) ([]byte, error) {
 		}
 
 		if !f.IsValid() {
-			n := -1
-			buf = appendInt(buf, int32(n))
+			buf = appendInt(buf, -1)
 			continue
 		} else if f.Kind() == reflect.Ptr {
 			if f.IsNil() {
-				n := -1
-				buf = appendInt(buf, int32(n))
+				buf = appendInt(buf, -1)
 				continue
 			} else {
 				f = f.Elem()