Skip to content

Commit

Permalink
Merge branch 'main' into feat/skip_dismatched
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Nov 2, 2022
2 parents a8e50bc + 2866800 commit b64e23e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ast/node.go
Expand Up @@ -695,14 +695,14 @@ func (self *Node) GetByPath(path ...interface{}) *Node {
}
var s = self
for _, p := range path {
switch p.(type) {
switch p := p.(type) {
case int:
s = s.Index(p.(int))
s = s.Index(p)
if !s.Valid() {
return s
}
case string:
s = s.Get(p.(string))
s = s.Get(p)
if !s.Valid() {
return s
}
Expand Down
6 changes: 3 additions & 3 deletions ast/search.go
Expand Up @@ -40,13 +40,13 @@ func (self *Searcher) GetByPath(path ...interface{}) (Node, error) {

var err types.ParsingError
for _, p := range path {
switch p.(type) {
switch p := p.(type) {
case int:
if err = self.parser.searchIndex(p.(int)); err != 0 {
if err = self.parser.searchIndex(p); err != 0 {
return Node{}, self.parser.ExportError(err)
}
case string:
if err = self.parser.searchKey(p.(string)); err != 0 {
if err = self.parser.searchKey(p); err != 0 {
return Node{}, self.parser.ExportError(err)
}
default:
Expand Down
4 changes: 2 additions & 2 deletions bench.py
Expand Up @@ -86,8 +86,8 @@ def compare(args):
run("%s %s ./... 2>&1 | tee %s" %(gbench_prefix, args, main))

# diff the result
benchstat = "go get golang.org/x/perf/cmd/benchstat && go install golang.org/x/perf/cmd/benchstat"
run( "%s && benchstat -sort=delta %s %s"%(benchstat, main, target))
# benchstat = "go get golang.org/x/perf/cmd/benchstat && go install golang.org/x/perf/cmd/benchstat"
run( "benchstat -sort=delta %s %s"%(main, target))
run("git checkout -- .")

# restore branch
Expand Down

0 comments on commit b64e23e

Please sign in to comment.