"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/golang.org/x/text/unicode/norm/composition.go" between
etcd-3.4.12.tar.gz and etcd-3.4.13.tar.gz

About: etcd is a distributed reliable key-value store for the most critical data of a distributed system (written in "Go").

composition.go  (etcd-3.4.12):composition.go  (etcd-3.4.13)
skipping to change at line 410 skipping to change at line 410
utf8.EncodeRune(buf[JamoUTF8Len:], jamoVBase+r%jamoVCount) utf8.EncodeRune(buf[JamoUTF8Len:], jamoVBase+r%jamoVCount)
if x != 0 { if x != 0 {
utf8.EncodeRune(buf[2*JamoUTF8Len:], jamoTBase+x) utf8.EncodeRune(buf[2*JamoUTF8Len:], jamoTBase+x)
return 3 * JamoUTF8Len return 3 * JamoUTF8Len
} }
return 2 * JamoUTF8Len return 2 * JamoUTF8Len
} }
// decomposeHangul algorithmically decomposes a Hangul rune into // decomposeHangul algorithmically decomposes a Hangul rune into
// its Jamo components. // its Jamo components.
// See http://unicode.org/reports/tr15/#Hangul for details on decomposing Hangul . // See https://unicode.org/reports/tr15/#Hangul for details on decomposing Hangu l.
func (rb *reorderBuffer) decomposeHangul(r rune) { func (rb *reorderBuffer) decomposeHangul(r rune) {
r -= hangulBase r -= hangulBase
x := r % jamoTCount x := r % jamoTCount
r /= jamoTCount r /= jamoTCount
rb.appendRune(jamoLBase + r/jamoVCount) rb.appendRune(jamoLBase + r/jamoVCount)
rb.appendRune(jamoVBase + r%jamoVCount) rb.appendRune(jamoVBase + r%jamoVCount)
if x != 0 { if x != 0 {
rb.appendRune(jamoTBase + x) rb.appendRune(jamoTBase + x)
} }
} }
// combineHangul algorithmically combines Jamo character components into Hangul. // combineHangul algorithmically combines Jamo character components into Hangul.
// See http://unicode.org/reports/tr15/#Hangul for details on combining Hangul. // See https://unicode.org/reports/tr15/#Hangul for details on combining Hangul.
func (rb *reorderBuffer) combineHangul(s, i, k int) { func (rb *reorderBuffer) combineHangul(s, i, k int) {
b := rb.rune[:] b := rb.rune[:]
bn := rb.nrune bn := rb.nrune
for ; i < bn; i++ { for ; i < bn; i++ {
cccB := b[k-1].ccc cccB := b[k-1].ccc
cccC := b[i].ccc cccC := b[i].ccc
if cccB == 0 { if cccB == 0 {
s = k - 1 s = k - 1
} }
if s != k-1 && cccB >= cccC { if s != k-1 && cccB >= cccC {
skipping to change at line 464 skipping to change at line 464
} }
} }
} }
rb.nrune = k rb.nrune = k
} }
// compose recombines the runes in the buffer. // compose recombines the runes in the buffer.
// It should only be used to recompose a single segment, as it will not // It should only be used to recompose a single segment, as it will not
// handle alternations between Hangul and non-Hangul characters correctly. // handle alternations between Hangul and non-Hangul characters correctly.
func (rb *reorderBuffer) compose() { func (rb *reorderBuffer) compose() {
// Lazily load the map used by the combine func below, but do
// it outside of the loop.
recompMapOnce.Do(buildRecompMap)
// UAX #15, section X5 , including Corrigendum #5 // UAX #15, section X5 , including Corrigendum #5
// "In any character sequence beginning with starter S, a character C is // "In any character sequence beginning with starter S, a character C is
// blocked from S if and only if there is some character B between S // blocked from S if and only if there is some character B between S
// and C, and either B is a starter or it has the same or higher // and C, and either B is a starter or it has the same or higher
// combining class as C." // combining class as C."
bn := rb.nrune bn := rb.nrune
if bn == 0 { if bn == 0 {
return return
} }
k := 1 k := 1
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)