Squishing out more performance.
This commit is contained in:
parent
83be756015
commit
a9964163c1
|
@ -32,7 +32,7 @@ func main() {
|
|||
flag.Usage()
|
||||
}
|
||||
|
||||
toml, err := parse.Run(os.Stdin)
|
||||
toml, err := parse.RunWithoutSanityChecks(os.Stdin)
|
||||
if err != nil {
|
||||
log.Fatalf("Error decoding TOML: %s", err)
|
||||
} else {
|
||||
|
|
|
@ -57,3 +57,11 @@ func Run(input interface{}) (ast.Table, error) {
|
|||
err := parse.New(p.startDocument)(input)
|
||||
return p.doc.Root, err
|
||||
}
|
||||
|
||||
// RunWithoutSanityChecks runs the TOML parser against the provided input data.
|
||||
// The parsekit sanity checks are disabled during the parse run.
|
||||
func RunWithoutSanityChecks(input interface{}) (ast.Table, error) {
|
||||
p := newParser()
|
||||
err := parse.New(p.startDocument)(input)
|
||||
return p.doc.Root, err
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/pkg/profile"
|
||||
)
|
||||
|
||||
const runProfiler = false
|
||||
const runProfiler = true
|
||||
|
||||
func main() {
|
||||
bytes, _ := ioutil.ReadAll(os.Stdin)
|
||||
|
|
BIN
parse2/parse2
BIN
parse2/parse2
Binary file not shown.
Loading…
Reference in New Issue