mirror of https://github.com/tidwall/tile38.git
lifted limit cap
This commit is contained in:
parent
d0f4f2ef73
commit
81ef8218fb
|
@ -3,6 +3,7 @@ package controller
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -14,7 +15,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const limitItems = 100
|
const limitItems = 100
|
||||||
const capLimit = 100000
|
|
||||||
|
|
||||||
type outputT int
|
type outputT int
|
||||||
|
|
||||||
|
@ -70,16 +70,18 @@ func (c *Controller) newScanWriter(
|
||||||
) (
|
) (
|
||||||
*scanWriter, error,
|
*scanWriter, error,
|
||||||
) {
|
) {
|
||||||
if limit == 0 {
|
|
||||||
limit = limitItems
|
|
||||||
} else if limit > capLimit {
|
|
||||||
limit = capLimit
|
|
||||||
}
|
|
||||||
switch output {
|
switch output {
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("invalid output type")
|
return nil, errors.New("invalid output type")
|
||||||
case outputIDs, outputObjects, outputCount, outputBounds, outputPoints, outputHashes:
|
case outputIDs, outputObjects, outputCount, outputBounds, outputPoints, outputHashes:
|
||||||
}
|
}
|
||||||
|
if limit == 0 {
|
||||||
|
if output == outputCount {
|
||||||
|
limit = math.MaxUint64
|
||||||
|
} else {
|
||||||
|
limit = limitItems
|
||||||
|
}
|
||||||
|
}
|
||||||
sw := &scanWriter{
|
sw := &scanWriter{
|
||||||
c: c,
|
c: c,
|
||||||
wr: wr,
|
wr: wr,
|
||||||
|
|
Loading…
Reference in New Issue