diff -Nru golang-github-rivo-uniseg-0.1.0/debian/changelog golang-github-rivo-uniseg-0.2.0/debian/changelog --- golang-github-rivo-uniseg-0.1.0/debian/changelog 2020-12-06 15:38:42.000000000 +0000 +++ golang-github-rivo-uniseg-0.2.0/debian/changelog 2020-12-13 19:01:53.000000000 +0000 @@ -1,3 +1,11 @@ +golang-github-rivo-uniseg (0.2.0-1) unstable; urgency=medium + + * New upstream release + * reverse dependencies successfully built with ratt: + - nothing todo for this package + + -- Thorsten Alteholz Sun, 13 Dec 2020 19:01:53 +0000 + golang-github-rivo-uniseg (0.1.0-2) unstable; urgency=medium * upload source package diff -Nru golang-github-rivo-uniseg-0.1.0/debian/control golang-github-rivo-uniseg-0.2.0/debian/control --- golang-github-rivo-uniseg-0.1.0/debian/control 2020-12-06 15:38:42.000000000 +0000 +++ golang-github-rivo-uniseg-0.2.0/debian/control 2020-12-13 19:01:15.000000000 +0000 @@ -1,5 +1,5 @@ Source: golang-github-rivo-uniseg -Section: devel +Section: golang Priority: optional Maintainer: Debian Go Packaging Team Uploaders: diff -Nru golang-github-rivo-uniseg-0.1.0/debian/watch golang-github-rivo-uniseg-0.2.0/debian/watch --- golang-github-rivo-uniseg-0.1.0/debian/watch 2019-08-31 13:56:13.000000000 +0000 +++ golang-github-rivo-uniseg-0.2.0/debian/watch 2020-12-13 19:01:47.000000000 +0000 @@ -1,4 +1,4 @@ version=4 opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-rivo-uniseg-\$1\.tar\.gz/,\ uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \ - https://github.com/rivo/uniseg/tags .*/v?(\d\S*)\.tar\.gz + https://github.com/rivo/uniseg/tags .*/v?(\d\S*)\.tar\.gz debian uupdate diff -Nru golang-github-rivo-uniseg-0.1.0/grapheme.go golang-github-rivo-uniseg-0.2.0/grapheme.go --- golang-github-rivo-uniseg-0.1.0/grapheme.go 2019-07-06 09:06:56.000000000 +0000 +++ golang-github-rivo-uniseg-0.2.0/grapheme.go 2020-10-19 13:44:17.000000000 +0000 @@ -1,5 +1,7 @@ package uniseg +import "unicode/utf8" + // The states of the grapheme cluster parser. const ( grAny = iota @@ -118,12 +120,20 @@ // NewGraphemes returns a new grapheme cluster iterator. func NewGraphemes(s string) *Graphemes { - g := &Graphemes{} - for index, codePoint := range s { - g.codePoints = append(g.codePoints, codePoint) - g.indices = append(g.indices, index) + l := utf8.RuneCountInString(s) + codePoints := make([]rune, l) + indices := make([]int, l+1) + i := 0 + for pos, r := range s { + codePoints[i] = r + indices[i] = pos + i++ + } + indices[l] = len(s) + g := &Graphemes{ + codePoints: codePoints, + indices: indices, } - g.indices = append(g.indices, len(s)) g.Next() // Parse ahead. return g }