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

Issue 151590043: code review 151590043: unicode: added In and NotIn methods to RangeTables. Thi...

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 6 months ago by mpvl
Modified:
9 years, 4 months ago
Reviewers:
CC:
r, golang-codereviews, nigeltao
Visibility:
Public.

Description

unicode: added In and NotIn methods to RangeTables. This allows RangeTables to directly be passed to Remove, Validate and possibly other funcs in the go.text/runes (see https://codereview.appspot.com/151580043/) or other go.text packages. For example, to get a transformer that removes modifiers, one would now write: isMn := func(r rune) bool { return unicode.In(r, unicode.Mn) } rmMn := runes.Remove(isMn) With this change it could be rewritten as: rmMn := runes.Remove(unicode.Mn.In) Note: inlining the body of Is in the new In methods seems to increase performance by about 15%. I havent done so for clarity, but it was one factor in the decision of adding these methods (versus adding helper funcs in the runes package, for example) as it will allow for a performance optimization that otherwise doesn't seem possible.

Patch Set 1 #

Patch Set 2 : diff -r c54b847a8ea3 https://code.google.com/p/go #

Patch Set 3 : diff -r c54b847a8ea3 https://code.google.com/p/go #

Patch Set 4 : diff -r 0bee9108569f https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M src/unicode/letter.go View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 4
mpvl
Hello r@golang.org (cc: golang-codereviews@googlegroups.com, nigeltao@golang.org), I'd like you to review this change to https://code.google.com/p/go
9 years, 6 months ago (2014-10-09 09:44:06 UTC) #1
r
This will have to wait for the 1.5 thaw when the 1.4 release is cut. ...
9 years, 6 months ago (2014-10-09 14:25:08 UTC) #2
mpvl
On Thu, Oct 9, 2014 at 4:25 PM, <r@golang.org> wrote: > This will have to ...
9 years, 6 months ago (2014-10-09 20:44:14 UTC) #3
gobot
9 years, 4 months ago (2014-12-19 05:13:52 UTC) #4
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/151590043 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

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