mirror of https://github.com/tidwall/tile38.git
Change 255 to 256
This commit is contained in:
parent
47a4e16c0b
commit
b467c6f1cb
|
@ -13,8 +13,8 @@ import (
|
|||
"github.com/tidwall/tile38/internal/deadline"
|
||||
)
|
||||
|
||||
// yieldStep forces the iterator to yield goroutine every 255 steps.
|
||||
const yieldStep = 255
|
||||
// yieldStep forces the iterator to yield goroutine every 256 steps.
|
||||
const yieldStep = 256
|
||||
|
||||
// Cursor allows for quickly paging through Scan, Within, Intersects, and Nearby
|
||||
type Cursor interface {
|
||||
|
@ -763,7 +763,7 @@ func (c *Collection) Nearby(
|
|||
}
|
||||
|
||||
func nextStep(step uint64, cursor Cursor, deadline *deadline.Deadline) {
|
||||
if step&yieldStep == yieldStep {
|
||||
if step&(yieldStep-1) == (yieldStep - 1) {
|
||||
runtime.Gosched()
|
||||
deadline.Check()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue