mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
util/deephash: remove unused stack slice in typeIsRecursive (#5363)
No operation ever reads from this variable. Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
parent
c200229f9e
commit
23ec3c104a
@ -646,8 +646,6 @@ func getTypeInfoLocked(t reflect.Type, incomplete map[reflect.Type]*typeInfo) *t
|
|||||||
func typeIsRecursive(t reflect.Type) bool {
|
func typeIsRecursive(t reflect.Type) bool {
|
||||||
inStack := map[reflect.Type]bool{}
|
inStack := map[reflect.Type]bool{}
|
||||||
|
|
||||||
var stack []reflect.Type
|
|
||||||
|
|
||||||
var visitType func(t reflect.Type) (isRecursiveSoFar bool)
|
var visitType func(t reflect.Type) (isRecursiveSoFar bool)
|
||||||
visitType = func(t reflect.Type) (isRecursiveSoFar bool) {
|
visitType = func(t reflect.Type) (isRecursiveSoFar bool) {
|
||||||
switch t.Kind() {
|
switch t.Kind() {
|
||||||
@ -678,11 +676,9 @@ func typeIsRecursive(t reflect.Type) bool {
|
|||||||
if inStack[t] {
|
if inStack[t] {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
stack = append(stack, t)
|
|
||||||
inStack[t] = true
|
inStack[t] = true
|
||||||
defer func() {
|
defer func() {
|
||||||
delete(inStack, t)
|
delete(inStack, t)
|
||||||
stack = stack[:len(stack)-1]
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
switch t.Kind() {
|
switch t.Kind() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user