ソースを参照

mobile: added constructor for BigInts (#17828)

Eugene Valeyev 7 年 前
コミット
a4428c505e
1 ファイル変更7 行追加0 行削除
  1. 7 0
      mobile/big.go

+ 7 - 0
mobile/big.go

@@ -84,6 +84,13 @@ func (bi *BigInt) SetString(x string, base int) {
 // BigInts represents a slice of big ints.
 type BigInts struct{ bigints []*big.Int }
 
+// NewBigInts creates a slice of uninitialized big numbers.
+func NewBigInts(size int) *BigInts {
+	return &BigInts{
+		bigints: make([]*big.Int, size),
+	}
+}
+
 // Size returns the number of big ints in the slice.
 func (bi *BigInts) Size() int {
 	return len(bi.bigints)