1 // Code generated by running "go run gen.go -core" in golang.org/x/text. DO NOT EDIT.
3 // Copyright 2011 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
9 type valueRange
struct {
10 value
uint16 // header: value:stride
11 lo
, hi
byte // header: lo:n
14 type sparseBlocks
struct {
19 var nfcSparse
= sparseBlocks
{
20 values
: nfcSparseValues
[:],
21 offset
: nfcSparseOffset
[:],
24 var nfkcSparse
= sparseBlocks
{
25 values
: nfkcSparseValues
[:],
26 offset
: nfkcSparseOffset
[:],
30 nfcData
= newNfcTrie(0)
31 nfkcData
= newNfkcTrie(0)
34 // lookupValue determines the type of block n and looks up the value for b.
35 // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block
36 // is a list of ranges with an accompanying value. Given a matching range r,
37 // the value for b is by r.value + (b - r.lo) * stride.
38 func (t
*sparseBlocks
) lookup(n
uint32, b
byte) uint16 {
40 header
:= t
.values
[offset
]
42 hi
:= lo
+ uint16(header
.lo
)
46 if r
.lo
<= b
&& b
<= r
.hi
{
47 return r
.value
+ uint16(b
-r
.lo
)*header
.value