mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
This reverts commit bba7c23957.
This commit is contained in:
18
vendor/github.com/golang-migrate/migrate/v4/source/migration.go
generated
vendored
18
vendor/github.com/golang-migrate/migrate/v4/source/migration.go
generated
vendored
@@ -66,13 +66,11 @@ func (i *Migrations) Append(m *Migration) (ok bool) {
|
||||
}
|
||||
|
||||
func (i *Migrations) buildIndex() {
|
||||
i.index = make(uintSlice, 0, len(i.migrations))
|
||||
i.index = make(uintSlice, 0)
|
||||
for version := range i.migrations {
|
||||
i.index = append(i.index, version)
|
||||
}
|
||||
sort.Slice(i.index, func(x, y int) bool {
|
||||
return i.index[x] < i.index[y]
|
||||
})
|
||||
sort.Sort(i.index)
|
||||
}
|
||||
|
||||
func (i *Migrations) First() (version uint, ok bool) {
|
||||
@@ -128,6 +126,18 @@ func (i *Migrations) findPos(version uint) int {
|
||||
|
||||
type uintSlice []uint
|
||||
|
||||
func (s uintSlice) Len() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func (s uintSlice) Swap(i, j int) {
|
||||
s[i], s[j] = s[j], s[i]
|
||||
}
|
||||
|
||||
func (s uintSlice) Less(i, j int) bool {
|
||||
return s[i] < s[j]
|
||||
}
|
||||
|
||||
func (s uintSlice) Search(x uint) int {
|
||||
return sort.Search(len(s), func(i int) bool { return s[i] >= x })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user