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

Issue 8306043: bson: make NewObjectId thread safe

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by rog
Modified:
12 years, 3 months ago
Reviewers:
mp+156789, dave, niemeyer
Visibility:
Public.

Description

bson: make NewObjectId thread safe Also use an array rather than a slice to remove a few unnecessary bounds checks. https://code.launchpad.net/~rogpeppe/mgo/thread-safe-newobject-2/+merge/156789 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : bson: make NewObjectId thread safe #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -13 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M bson/bson.go View 3 chunks +11 lines, -13 lines 2 comments Download

Messages

Total messages: 5
rog
Please take a look.
12 years, 3 months ago (2013-04-03 09:55:15 UTC) #1
dave_cheney.net
LGTM with the optimization rolled back. https://codereview.appspot.com/8306043/diff/2001/bson/bson.go File bson/bson.go (right): https://codereview.appspot.com/8306043/diff/2001/bson/bson.go#newcode205 bson/bson.go:205: var b [12]byte ...
12 years, 3 months ago (2013-04-03 09:56:32 UTC) #2
niemeyer
LGTM
12 years, 3 months ago (2013-04-03 14:26:48 UTC) #3
niemeyer
*** Submitted: bson: make NewObjectId thread safe R=dfc, niemeyer CC= https://codereview.appspot.com/8306043
12 years, 3 months ago (2013-04-03 14:46:51 UTC) #4
niemeyer
12 years, 3 months ago (2013-04-03 14:48:40 UTC) #5
https://codereview.appspot.com/8306043/diff/2001/bson/bson.go
File bson/bson.go (right):

https://codereview.appspot.com/8306043/diff/2001/bson/bson.go#newcode205
bson/bson.go:205: var b [12]byte
On 2013/04/03 09:56:32, dfc wrote:
> premature optimisation alert.

I agree it's premature optimization. I've merged it on the basis that the code
looks equally clean.
Sign in to reply to this message.

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