Commit a8357f01 authored by Marcel van Lohuizen's avatar Marcel van Lohuizen

exp/locale/collate/build: fixed bug that was exposed by experimenting

with table changes.
NOTE: there is no test for this, but 1) the code has now the same
control flow as scan in exp/locale/collate/contract.go, which is
tested and 2) Builder verifies the generated table so bugs in this
code are quickly and easily found (which is how this bug was discovered).

R=r
CC=golang-dev
https://golang.org/cl/6461082
parent 98883c81
......@@ -241,8 +241,8 @@ func (ct *contractTrieSet) lookup(h ctHandle, str []byte) (index, ns int) {
e := states[i]
c := str[p]
if c >= e.l {
p++
if e.l == c {
p++
if e.i != noIndex {
index, ns = int(e.i), p
}
......@@ -252,12 +252,13 @@ func (ct *contractTrieSet) lookup(h ctHandle, str []byte) (index, ns int) {
} else {
return
}
continue
} else if e.n == final && c <= e.h {
p++
return int(c-e.l) + int(e.i), p
}
} else {
i++
}
i++
}
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment