Procházet zdrojové kódy

Simplify Uint32 helper function to be like the others.

David Symonds před 11 roky
rodič
revize
60976d353e
1 změnil soubory, kde provedl 1 přidání a 3 odebrání
  1. 1 3
      proto/lib.go

+ 1 - 3
proto/lib.go

@@ -323,9 +323,7 @@ func Float64(v float64) *float64 {
 // Uint32 is a helper routine that allocates a new uint32 value
 // to store v and returns a pointer to it.
 func Uint32(v uint32) *uint32 {
-	p := new(uint32)
-	*p = v
-	return p
+	return &v
 }
 
 // Uint64 is a helper routine that allocates a new uint64 value