]> Cypherpunks repositories - gostls13.git/commit
runtime: introduce treapForSpan to reduce code duplication
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 29 Mar 2019 16:02:05 +0000 (16:02 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 10 Apr 2019 22:01:12 +0000 (22:01 +0000)
commit7b33b6274f36ecc5dd5c24c99c2f72d3edf79b3d
treedff7833da513e5e12a0e97ff0dee70dafb5eecf8
parentd13a9312f52a3e861e02aff8ccb3f237b45b0822
runtime: introduce treapForSpan to reduce code duplication

Currently which treap a span should be inserted into/removed from is
checked by looking at the span's properties. This logic is repeated in
four places. As this logic gets more complex, it makes sense to
de-duplicate this, so introduce treapForSpan instead which captures this
logic by returning the appropriate treap for the span.

For #30333.

Change-Id: I4bd933d93dc50c5fc7c7c7f56ceb95194dcbfbcc
Reviewed-on: https://go-review.googlesource.com/c/go/+/170857
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/mheap.go