Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(73)

Issue 5301056: code review 5301056: big: usable zero Rat values without need for explicit i... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by gri
Modified:
13 years, 11 months ago
Reviewers:
rog
CC:
r, golang-dev
Visibility:
Public.

Description

big: usable zero Rat values without need for explicit initialization - no explicit API change, but new(big.Rat) now creates a big.Rat value of 0 that is immediately usable, in sync. w/ the conventions elsewhere - various cleanups along the way

Patch Set 1 #

Patch Set 2 : diff -r e2a58806ccd6 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r e2a58806ccd6 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r defd1b970155 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r defd1b970155 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r defd1b970155 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r b8d3c48ba72d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -63 lines) Patch
M src/pkg/big/int.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/big/nat.go View 1 2 3 5 chunks +6 lines, -7 lines 0 comments Download
M src/pkg/big/nat_test.go View 1 6 chunks +10 lines, -10 lines 0 comments Download
M src/pkg/big/rat.go View 1 2 3 4 12 chunks +87 lines, -42 lines 0 comments Download
M src/pkg/big/rat_test.go View 1 2 3 4 chunks +43 lines, -3 lines 0 comments Download

Messages

Total messages: 6
gri
Hello rogpeppe@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-10-20 23:24:53 UTC) #1
gri
Hello r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-10-21 20:56:09 UTC) #2
r
LGTM
13 years, 11 months ago (2011-10-21 21:07:38 UTC) #3
gri
*** Submitted as http://code.google.com/p/go/source/detail?r=f1a2043b33cd *** big: usable zero Rat values without need for explicit initialization ...
13 years, 11 months ago (2011-10-21 21:11:39 UTC) #4
rog
[sorry for slow response - i've been abroad since wednesday] LGTM, except that i think ...
13 years, 11 months ago (2011-10-24 10:48:35 UTC) #5
rog
13 years, 11 months ago (2011-10-24 12:09:32 UTC) #6
On 24 October 2011 12:48, roger peppe <rogpeppe@gmail.com> wrote:
> LGTM, except that i think that nat{} should be written as nat(nil)
> throughout, which will save an unnecessary allocation each time, AFAICS.

actually it occurs to me that an easy compiler optimisation would be to
use the same data pointer when making all zero-length slices,
thus avoiding the need for nat{} to do an allocation.

i can't off-hand think of anything this would break, as slices
aren't comparable, and there's no element to take the address of.
(Printf("%p") is one place non-unsafe code can observe it, but
i don't see that's necessarily a problem).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b