diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/uptrace/bun/internal/map_key.go | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/uptrace/bun/internal/map_key.go')
| -rw-r--r-- | vendor/github.com/uptrace/bun/internal/map_key.go | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/vendor/github.com/uptrace/bun/internal/map_key.go b/vendor/github.com/uptrace/bun/internal/map_key.go deleted file mode 100644 index d7e4de2b9..000000000 --- a/vendor/github.com/uptrace/bun/internal/map_key.go +++ /dev/null @@ -1,67 +0,0 @@ -package internal - -import "reflect" - -var ifaceType = reflect.TypeFor[interface{}]() - -type MapKey struct { - iface interface{} -} - -func NewMapKey(is []interface{}) MapKey { - return MapKey{ - iface: newMapKey(is), - } -} - -func newMapKey(is []interface{}) interface{} { - switch len(is) { - case 1: - ptr := new([1]interface{}) - copy((*ptr)[:], is) - return *ptr - case 2: - ptr := new([2]interface{}) - copy((*ptr)[:], is) - return *ptr - case 3: - ptr := new([3]interface{}) - copy((*ptr)[:], is) - return *ptr - case 4: - ptr := new([4]interface{}) - copy((*ptr)[:], is) - return *ptr - case 5: - ptr := new([5]interface{}) - copy((*ptr)[:], is) - return *ptr - case 6: - ptr := new([6]interface{}) - copy((*ptr)[:], is) - return *ptr - case 7: - ptr := new([7]interface{}) - copy((*ptr)[:], is) - return *ptr - case 8: - ptr := new([8]interface{}) - copy((*ptr)[:], is) - return *ptr - case 9: - ptr := new([9]interface{}) - copy((*ptr)[:], is) - return *ptr - case 10: - ptr := new([10]interface{}) - copy((*ptr)[:], is) - return *ptr - default: - } - - at := reflect.New(reflect.ArrayOf(len(is), ifaceType)).Elem() - for i, v := range is { - *(at.Index(i).Addr().Interface().(*interface{})) = v - } - return at.Interface() -} |
