From 7978d07d5bbd72ca84c9650bf2450d7a269bbb1d Mon Sep 17 00:00:00 2001 From: Dmitriy Matrenichev Date: Tue, 23 Apr 2024 00:07:33 +0300 Subject: [PATCH] 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. --- src/internal/weak/pointer.go | 4 ++-- 1 file 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.