summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/util.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-22 12:26:47 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-22 12:26:47 +0100
commit0ceacd7b1d0b03e3da1d552aa0bbbe7037e57e90 (patch)
tree106bd6f80fe5466522b37b5778ebc7c4fd6ab728 /vendor/github.com/uptrace/bun/util.go
parent[chore] Add name to instance field for autosuggestion (#1359) (diff)
downloadgotosocial-0ceacd7b1d0b03e3da1d552aa0bbbe7037e57e90.tar.xz
[chore] bump db dependencies (#1366)
Diffstat (limited to 'vendor/github.com/uptrace/bun/util.go')
-rw-r--r--vendor/github.com/uptrace/bun/util.go46
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/github.com/uptrace/bun/util.go b/vendor/github.com/uptrace/bun/util.go
index ce56be805..09ffbb996 100644
--- a/vendor/github.com/uptrace/bun/util.go
+++ b/vendor/github.com/uptrace/bun/util.go
@@ -66,49 +66,3 @@ func sliceElemType(v reflect.Value) reflect.Type {
}
return indirectType(elemType)
}
-
-func makeSliceNextElemFunc(v reflect.Value) func() reflect.Value {
- if v.Kind() == reflect.Array {
- var pos int
- return func() reflect.Value {
- v := v.Index(pos)
- pos++
- return v
- }
- }
-
- sliceType := v.Type()
- elemType := sliceType.Elem()
-
- if elemType.Kind() == reflect.Ptr {
- elemType = elemType.Elem()
- return func() reflect.Value {
- if v.Len() < v.Cap() {
- v.Set(v.Slice(0, v.Len()+1))
- elem := v.Index(v.Len() - 1)
- if elem.IsNil() {
- elem.Set(reflect.New(elemType))
- }
- return elem.Elem()
- }
-
- elem := reflect.New(elemType)
- v.Set(reflect.Append(v, elem))
- return elem.Elem()
- }
- }
-
- zero := reflect.Zero(elemType)
- return func() reflect.Value {
- l := v.Len()
- c := v.Cap()
-
- if l < c {
- v.Set(v.Slice(0, l+1))
- return v.Index(l)
- }
-
- v.Set(reflect.Append(v, zero))
- return v.Index(l)
- }
-}