From: Robert Griesemer Date: Wed, 8 Jun 2011 18:24:24 +0000 (-0700) Subject: big: removed some gratuitous +/-1's X-Git-Tag: weekly.2011-06-09~23 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2de06655f1fb27bcbe61e1c091ac24448d3fe9c6;p=gostls13.git big: removed some gratuitous +/-1's R=mtj, bradfitz CC=golang-dev https://golang.org/cl/4584046 --- diff --git a/src/pkg/big/nat.go b/src/pkg/big/nat.go index ea1903b166..734568e068 100755 --- a/src/pkg/big/nat.go +++ b/src/pkg/big/nat.go @@ -764,13 +764,12 @@ func (x nat) string(charset string) string { if b == b&-b { // shift is base-b digit size in bits shift := uint(trailingZeroBits(b)) // shift > 0 because b >= 2 - m := len(x) mask := Word(1)<= shift { i-- @@ -782,16 +781,16 @@ func (x nat) string(charset string) string { // convert any partial leading digit and advance to next word if nbits == 0 { // no partial digit remaining, just advance - w = x[k+1] + w = x[k] nbits = _W } else { - // partial digit in current (k) and next (k+1) word - w |= x[k+1] << nbits + // partial digit in current (k-1) and next (k) word + w |= x[k] << nbits i-- s[i] = charset[w&mask] // advance - w = x[k+1] >> (shift - nbits) + w = x[k] >> (shift - nbits) nbits = _W - (shift - nbits) } }