Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Sep 2, 2024
1 parent 979bdeb commit ae5fb3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions private/path/combinator/combinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ func fingerprint(interfaces []snet.PathInterface, st hashState) snet.PathFingerp
return snet.PathFingerprint(h.Sum(st.buf[:0]))
}

func checkUnderlyingType[S ~string](_ S) bool { return true }

// This check ensures that the underlying type of the PathFingerprint
// is string. This is required to create a copy of the buffer. If it were
// to be moved to a []byte, we need to change the code to create
// a proper copy.
var _ = checkUnderlyingType(snet.PathFingerprint(""))

type hashState struct {
hash hash.Hash
buf []byte
Expand Down

0 comments on commit ae5fb3b

Please sign in to comment.