aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Matrenichev <temp65535@gmail.com>2024-04-22 22:26:33 +0000
committerGopher Robot <gobot@golang.org>2024-04-26 22:13:25 +0000
commit9effeeab27de2a8f75a1050ce879ba8db3abb406 (patch)
tree1d890881f9509d388870096e02ec5afac6d125f1
parentb439f3285962e9a263ea7511f19aac0a875d17cf (diff)
downloadgo-9effeeab27de2a8f75a1050ce879ba8db3abb406.tar.gz
go-9effeeab27de2a8f75a1050ce879ba8db3abb406.zip
internal/weak: remove unnecessary conversion, fix typo
Remove unnecessary conversion from unsafe.Pointer to unsafe.Pointer. Also fix small typo in weak.Pointer.Strong method documentation. Change-Id: I84791fba244581bd6218c589827a61914f0797b4 GitHub-Last-Rev: 7978d07d5bbd72ca84c9650bf2450d7a269bbb1d GitHub-Pull-Request: golang/go#66977 Reviewed-on: https://go-review.googlesource.com/c/go/+/580936 Reviewed-by: Michael Knyszek <mknyszek@google.com> Commit-Queue: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joedian Reid <joedian@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/internal/weak/pointer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/weak/pointer.go b/src/internal/weak/pointer.go
index 44d26738bc..8e05af2d23 100644
--- a/src/internal/weak/pointer.go
+++ b/src/internal/weak/pointer.go
@@ -68,10 +68,10 @@ func Make[T any](ptr *T) Pointer[T] {
// Strong creates a strong pointer from the weak pointer.
// Returns nil if the original value for the weak pointer was reclaimed by
// the garbage collector.
-// If a weak pointer points to an object with a finalizer, thhen Strong will
+// If a weak pointer points to an object with a finalizer, then Strong will
// return nil as soon as the object's finalizer is queued for execution.
func (p Pointer[T]) Strong() *T {
- return (*T)(runtime_makeStrongFromWeak(unsafe.Pointer(p.u)))
+ return (*T)(runtime_makeStrongFromWeak(p.u))
}
// Implemented in runtime.