summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-02-13 08:53:40 +0000
committerLibravatar GitHub <noreply@github.com>2025-02-13 09:53:40 +0100
commit24f6760c0e355903458f71e539201c8bf37cfac6 (patch)
treec5f43e72ba452fddceb3c2531a64d4b835246927 /vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go
parent[feature] Implement backfilling statuses thru scheduled_at (#3685) (diff)
downloadgotosocial-24f6760c0e355903458f71e539201c8bf37cfac6.tar.xz
[chore] bump ncruces go-sqlite3 => v0.23.0 (#3785)
* bump ncruces go-sqlite3 => v0.23.0 * whoops, add missing vendor changes...
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go b/vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go
index e4e338549..f9f39b449 100644
--- a/vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go
+++ b/vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go
@@ -20,7 +20,7 @@ func (s *handleState) CloseNotify(ctx context.Context, exitCode uint32) {
s.holes = 0
}
-func GetHandle(ctx context.Context, id uint32) any {
+func GetHandle(ctx context.Context, id Ptr_t) any {
if id == 0 {
return nil
}
@@ -28,14 +28,14 @@ func GetHandle(ctx context.Context, id uint32) any {
return s.handles[^id]
}
-func DelHandle(ctx context.Context, id uint32) error {
+func DelHandle(ctx context.Context, id Ptr_t) error {
if id == 0 {
return nil
}
s := ctx.Value(moduleKey{}).(*moduleState)
a := s.handles[^id]
s.handles[^id] = nil
- if l := uint32(len(s.handles)); l == ^id {
+ if l := Ptr_t(len(s.handles)); l == ^id {
s.handles = s.handles[:l-1]
} else {
s.holes++
@@ -46,7 +46,7 @@ func DelHandle(ctx context.Context, id uint32) error {
return nil
}
-func AddHandle(ctx context.Context, a any) uint32 {
+func AddHandle(ctx context.Context, a any) Ptr_t {
if a == nil {
panic(NilErr)
}
@@ -59,12 +59,12 @@ func AddHandle(ctx context.Context, a any) uint32 {
if h == nil {
s.holes--
s.handles[id] = a
- return ^uint32(id)
+ return ^Ptr_t(id)
}
}
}
// Add a new slot.
s.handles = append(s.handles, a)
- return -uint32(len(s.handles))
+ return -Ptr_t(len(s.handles))
}