VOL-2408 - Refactor / Use voltha-lib-go Logging
Change-Id: I6e7d9eaba49c104cd50bb5692a2ff9733014fac4
diff --git a/vendor/golang.org/x/text/unicode/norm/maketables.go b/vendor/golang.org/x/text/unicode/norm/maketables.go
index 338c395..30a3aa9 100644
--- a/vendor/golang.org/x/text/unicode/norm/maketables.go
+++ b/vendor/golang.org/x/text/unicode/norm/maketables.go
@@ -12,6 +12,7 @@
import (
"bytes"
+ "encoding/binary"
"flag"
"fmt"
"io"
@@ -261,7 +262,7 @@
// CompositionExclusions.txt has form:
// 0958 # ...
-// See http://unicode.org/reports/tr44/ for full explanation
+// See https://unicode.org/reports/tr44/ for full explanation
func loadCompositionExclusions() {
f := gen.OpenUCDFile("CompositionExclusions.txt")
defer f.Close()
@@ -735,6 +736,8 @@
max = n
}
}
+ fmt.Fprintln(w, `import "sync"`)
+ fmt.Fprintln(w)
fmt.Fprintln(w, "const (")
fmt.Fprintln(w, "\t// Version is the Unicode edition from which the tables are derived.")
@@ -782,16 +785,23 @@
sz := nrentries * 8
size += sz
fmt.Fprintf(w, "// recompMap: %d bytes (entries only)\n", sz)
- fmt.Fprintln(w, "var recompMap = map[uint32]rune{")
+ fmt.Fprintln(w, "var recompMap map[uint32]rune")
+ fmt.Fprintln(w, "var recompMapOnce sync.Once\n")
+ fmt.Fprintln(w, `const recompMapPacked = "" +`)
+ var buf [8]byte
for i, c := range chars {
f := c.forms[FCanonical]
d := f.decomp
if !f.isOneWay && len(d) > 0 {
key := uint32(uint16(d[0]))<<16 + uint32(uint16(d[1]))
- fmt.Fprintf(w, "0x%.8X: 0x%.4X,\n", key, i)
+ binary.BigEndian.PutUint32(buf[:4], key)
+ binary.BigEndian.PutUint32(buf[4:], uint32(i))
+ fmt.Fprintf(w, "\t\t%q + // 0x%.8X: 0x%.8X\n", string(buf[:]), key, uint32(i))
}
}
- fmt.Fprintf(w, "}\n\n")
+ // hack so we don't have to special case the trailing plus sign
+ fmt.Fprintf(w, ` ""`)
+ fmt.Fprintln(w)
}
fmt.Fprintf(w, "// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size)
@@ -857,7 +867,7 @@
// DerivedNormalizationProps.txt has form:
// 00C0..00C5 ; NFD_QC; N # ...
// 0374 ; NFD_QC; N # ...
-// See http://unicode.org/reports/tr44/ for full explanation
+// See https://unicode.org/reports/tr44/ for full explanation
func testDerived() {
f := gen.OpenUCDFile("DerivedNormalizationProps.txt")
defer f.Close()