]> Cypherpunks repositories - gostls13.git/commit
exp/locale/collate: removed weights struct to allow for faster and easier
authorMarcel van Lohuizen <mpvl@golang.org>
Wed, 31 Oct 2012 13:28:18 +0000 (14:28 +0100)
committerMarcel van Lohuizen <mpvl@golang.org>
Wed, 31 Oct 2012 13:28:18 +0000 (14:28 +0100)
commit4c1a6f84f8d85ad809ef14a685e173b73abb4621
treed88f2daf68868d936c44f95cd0bc74f395f42af7
parentbc0783dbe5c0b1319843f9a97df946549a24b7b1
exp/locale/collate: removed weights struct to allow for faster and easier
incremental comparisons. Instead, processing is now done directly on colElems.
As a result, the size of the weights array is now reduced by 75%.
Details:
- Primary value of type 1 colElem is shifted by 1 bit so that primaries
  of all types can be compared without shifting.
- Quaternary values are now stored in the colElem itself. This is possible
  as quaternary values other than 0 or maxQuaternary are only needed when other
  values are ignored.
- Simplified processWeights by removing cases that are needed for ICU but not
  for us (our CJK primary values fit in a single value).

R=r
CC=golang-dev
https://golang.org/cl/6817054
src/pkg/exp/locale/collate/build/colelem.go
src/pkg/exp/locale/collate/build/colelem_test.go
src/pkg/exp/locale/collate/colelem.go
src/pkg/exp/locale/collate/colelem_test.go
src/pkg/exp/locale/collate/collate.go
src/pkg/exp/locale/collate/export_test.go
src/pkg/exp/locale/collate/table.go