Files
releases/vendor/github.com/sergi/go-diff/diffmatchpatch/index.go
T
dependabot[bot] f5f00a9108 build(deps): bump the dependencies group across 1 directory with 10 updates (#7803)
Bumps the dependencies group with 10 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) | `2.1.1` | `2.1.3` |
| [github.com/dgraph-io/badger/v4](https://github.com/dgraph-io/badger) | `4.7.0` | `4.8.0` |
| [github.com/sergi/go-diff](https://github.com/sergi/go-diff) | `1.3.1` | `1.4.0` |
| [github.com/spf13/pflag](https://github.com/spf13/pflag) | `1.0.6` | `1.0.7` |
| [github.com/tchap/go-patricia/v2](https://github.com/tchap/go-patricia) | `2.3.2` | `2.3.3` |
| [github.com/vektah/gqlparser/v2](https://github.com/vektah/gqlparser) | `2.5.28` | `2.5.30` |
| [golang.org/x/net](https://github.com/golang/net) | `0.41.0` | `0.42.0` |
| [golang.org/x/time](https://github.com/golang/time) | `0.11.0` | `0.12.0` |
| [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.73.0` | `1.74.2` |
| [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) | `1.4.0` | `1.6.0` |



Updates `github.com/containerd/containerd/v2` from 2.1.1 to 2.1.3
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.1...v2.1.3)

Updates `github.com/dgraph-io/badger/v4` from 4.7.0 to 4.8.0
- [Release notes](https://github.com/dgraph-io/badger/releases)
- [Changelog](https://github.com/hypermodeinc/badger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dgraph-io/badger/compare/v4.7.0...v4.8.0)

Updates `github.com/sergi/go-diff` from 1.3.1 to 1.4.0
- [Commits](https://github.com/sergi/go-diff/compare/v1.3.1...v1.4.0)

Updates `github.com/spf13/pflag` from 1.0.6 to 1.0.7
- [Release notes](https://github.com/spf13/pflag/releases)
- [Commits](https://github.com/spf13/pflag/compare/v1.0.6...v1.0.7)

Updates `github.com/tchap/go-patricia/v2` from 2.3.2 to 2.3.3
- [Commits](https://github.com/tchap/go-patricia/compare/v2.3.2...v2.3.3)

Updates `github.com/vektah/gqlparser/v2` from 2.5.28 to 2.5.30
- [Release notes](https://github.com/vektah/gqlparser/releases)
- [Commits](https://github.com/vektah/gqlparser/compare/v2.5.28...v2.5.30)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/time` from 0.11.0 to 0.12.0
- [Commits](https://github.com/golang/time/compare/v0.11.0...v0.12.0)

Updates `google.golang.org/grpc` from 1.73.0 to 1.74.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.73.0...v1.74.2)

Updates `sigs.k8s.io/yaml` from 1.4.0 to 1.6.0
- [Release notes](https://github.com/kubernetes-sigs/yaml/releases)
- [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.4.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: github.com/dgraph-io/badger/v4
  dependency-version: 4.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: github.com/sergi/go-diff
  dependency-version: 1.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: github.com/spf13/pflag
  dependency-version: 1.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: github.com/tchap/go-patricia/v2
  dependency-version: 2.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: github.com/vektah/gqlparser/v2
  dependency-version: 2.5.30
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: golang.org/x/time
  dependency-version: 0.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: google.golang.org/grpc
  dependency-version: 1.74.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: sigs.k8s.io/yaml
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-29 15:46:18 +02:00

33 lines
700 B
Go

package diffmatchpatch
type index uint32
const runeSkipStart = 0xd800
const runeSkipEnd = 0xdfff + 1
const runeMax = 0x110000 // next invalid code point
func stringToIndex(text string) []index {
runes := []rune(text)
indexes := make([]index, len(runes))
for i, r := range runes {
if r < runeSkipEnd {
indexes[i] = index(r)
} else {
indexes[i] = index(r) - (runeSkipEnd - runeSkipStart)
}
}
return indexes
}
func indexesToString(indexes []index) string {
runes := make([]rune, len(indexes))
for i, index := range indexes {
if index < runeSkipStart {
runes[i] = rune(index)
} else {
runes[i] = rune(index + (runeSkipEnd - runeSkipStart))
}
}
return string(runes)
}