aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/pprof
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/pprof')
-rw-r--r--src/runtime/pprof/pprof_test.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index 4b8f29c918..5477d9ed26 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -2558,15 +2558,7 @@ func TestProfilerStackDepth(t *testing.T) {
}
func hasPrefix(stk []string, prefix []string) bool {
- if len(prefix) > len(stk) {
- return false
- }
- for i := range prefix {
- if stk[i] != prefix[i] {
- return false
- }
- }
- return true
+ return len(prefix) <= len(stk) && slices.Equal(stk[:len(prefix)], prefix)
}
// ensure that stack records are valid map keys (comparable)