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"
|
"github.com/tidwall/tile38/internal/deadline"
|
||||||
)
|
)
|
||||||
|
|
||||||
// yieldStep forces the iterator to yield goroutine every 255 steps.
|
// yieldStep forces the iterator to yield goroutine every 256 steps.
|
||||||
const yieldStep = 255
|
const yieldStep = 256
|
||||||
|
|
||||||
// Cursor allows for quickly paging through Scan, Within, Intersects, and Nearby
|
// Cursor allows for quickly paging through Scan, Within, Intersects, and Nearby
|
||||||
type Cursor interface {
|
type Cursor interface {
|
||||||
|
@ -763,7 +763,7 @@ func (c *Collection) Nearby(
|
||||||
}
|
}
|
||||||
|
|
||||||
func nextStep(step uint64, cursor Cursor, deadline *deadline.Deadline) {
|
func nextStep(step uint64, cursor Cursor, deadline *deadline.Deadline) {
|
||||||
if step&yieldStep == yieldStep {
|
if step&(yieldStep-1) == (yieldStep - 1) {
|
||||||
runtime.Gosched()
|
runtime.Gosched()
|
||||||
deadline.Check()
|
deadline.Check()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue