diff options
author | ale <ale@incal.net> | 2018-08-31 08:28:51 +0100 |
---|---|---|
committer | ale <ale@incal.net> | 2018-08-31 08:28:51 +0100 |
commit | b3d419486a87c9193c2fd6c16168f600876e0f73 (patch) | |
tree | 849d1333d4fac8e5654e65a0fdf4b2cb00355ab9 /vendor/golang.org/x/text/unicode/norm/composition.go | |
parent | 86a0bd2d15a07662fdae4e24589b08706c2e80b9 (diff) | |
download | crawl-b3d419486a87c9193c2fd6c16168f600876e0f73.tar.gz crawl-b3d419486a87c9193c2fd6c16168f600876e0f73.zip |
Update dependencies
Diffstat (limited to 'vendor/golang.org/x/text/unicode/norm/composition.go')
-rw-r--r-- | vendor/golang.org/x/text/unicode/norm/composition.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/golang.org/x/text/unicode/norm/composition.go b/vendor/golang.org/x/text/unicode/norm/composition.go index bab4c5d..e2087bc 100644 --- a/vendor/golang.org/x/text/unicode/norm/composition.go +++ b/vendor/golang.org/x/text/unicode/norm/composition.go @@ -407,7 +407,7 @@ func decomposeHangul(buf []byte, r rune) int { // decomposeHangul algorithmically decomposes a Hangul rune into // 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 Hangul. func (rb *reorderBuffer) decomposeHangul(r rune) { r -= hangulBase x := r % jamoTCount @@ -420,7 +420,7 @@ func (rb *reorderBuffer) decomposeHangul(r rune) { } // 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) { b := rb.rune[:] bn := rb.nrune @@ -461,6 +461,10 @@ func (rb *reorderBuffer) combineHangul(s, i, k int) { // It should only be used to recompose a single segment, as it will not // handle alternations between Hangul and non-Hangul characters correctly. 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 // "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 |