mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] self-referencing collection pages for status replies (#2364)
This commit is contained in:
@@ -33,3 +33,11 @@ func EqualPtrs[T comparable](t1, t2 *T) bool {
|
||||
func Ptr[T any](t T) *T {
|
||||
return &t
|
||||
}
|
||||
|
||||
// PtrValueOr returns either value of ptr, or default.
|
||||
func PtrValueOr[T any](t *T, _default T) T {
|
||||
if t != nil {
|
||||
return *t
|
||||
}
|
||||
return _default
|
||||
}
|
||||
|
Reference in New Issue
Block a user