aboutsummaryrefslogtreecommitdiff
path: root/src/math/big/ratmarsh.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2015-09-25 15:11:14 -0700
committerRobert Griesemer <gri@golang.org>2015-09-25 22:25:52 +0000
commit59129c6a9356af5831b3f0a4bc581ba6abf26c8a (patch)
tree855eeecbc6a87358294b6219c71c16dcdc68248f /src/math/big/ratmarsh.go
parent7fa5a11ea1e876bd9d72b0ed2e2821597f76a495 (diff)
downloadgo-59129c6a9356af5831b3f0a4bc581ba6abf26c8a.tar.gz
go-59129c6a9356af5831b3f0a4bc581ba6abf26c8a.zip
math/big: remove some string conversions in Int encoding
Change-Id: I1180aa3d30fb8563c8e6ecefeb3296af0a88f5a6 Reviewed-on: https://go-review.googlesource.com/14998 Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/math/big/ratmarsh.go')
-rw-r--r--src/math/big/ratmarsh.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/math/big/ratmarsh.go b/src/math/big/ratmarsh.go
index b79cbe6652..6bb9d8af60 100644
--- a/src/math/big/ratmarsh.go
+++ b/src/math/big/ratmarsh.go
@@ -59,11 +59,13 @@ func (z *Rat) GobDecode(buf []byte) error {
// MarshalText implements the encoding.TextMarshaler interface.
func (r *Rat) MarshalText() (text []byte, err error) {
+ // TODO(gri): get rid of the []byte/string conversion
return []byte(r.RatString()), nil
}
// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (r *Rat) UnmarshalText(text []byte) error {
+ // TODO(gri): get rid of the []byte/string conversion
if _, ok := r.SetString(string(text)); !ok {
return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Rat", text)
}