Skip to content

Commit

Permalink
remove unused parameter (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsaiYusuke authored Jan 22, 2023
1 parent 78c169a commit b603109
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions syntax_basic_compare_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ type syntaxBasicCompareParameter struct {
}

func (p *syntaxBasicCompareParameter) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

if _, ok := p.param.(*syntaxQueryParamRoot); ok {
currentList = []interface{}{root}
}

return p.param.compute(root, currentList, container)
return p.param.compute(root, currentList)
}
6 changes: 3 additions & 3 deletions syntax_basic_compare_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ type syntaxBasicCompareQuery struct {
}

func (q *syntaxBasicCompareQuery) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

leftValues := q.leftParam.compute(root, currentList, container)
leftValues := q.leftParam.compute(root, currentList)
leftFound := q.comparator.typeCast(leftValues)

rightValues := q.rightParam.compute(root, currentList, container)
rightValues := q.rightParam.compute(root, currentList)
rightFound := q.comparator.typeCast(rightValues)

if leftFound && rightFound {
Expand Down
2 changes: 1 addition & 1 deletion syntax_if_query.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package jsonpath

type syntaxQuery interface {
compute(root interface{}, currentList []interface{}, container *bufferContainer) []interface{}
compute(root interface{}, currentList []interface{}) []interface{}
}
4 changes: 2 additions & 2 deletions syntax_node_qualifier_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (f *syntaxFilterQualifier) retrieveMap(
valueList[index] = srcMap[(*sortKeys)[index]]
}

valueList = f.query.compute(root, valueList, container)
valueList = f.query.compute(root, valueList)

isEachResult := len(valueList) == len(srcMap)

Expand Down Expand Up @@ -91,7 +91,7 @@ func (f *syntaxFilterQualifier) retrieveList(
var deepestTextLen int
var deepestError errorRuntime

valueList := f.query.compute(root, srcList, container)
valueList := f.query.compute(root, srcList)

isEachResult := len(valueList) == len(srcList)

Expand Down
8 changes: 4 additions & 4 deletions syntax_query_logical_and.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ type syntaxLogicalAnd struct {
}

func (l *syntaxLogicalAnd) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

leftComputedList := l.leftQuery.compute(root, currentList, container)
leftComputedList := l.leftQuery.compute(root, currentList)
if len(leftComputedList) == 1 {
if _, ok := leftComputedList[0].(struct{}); ok {
return leftComputedList
}
return l.rightQuery.compute(root, currentList, container)
return l.rightQuery.compute(root, currentList)
}

rightComputedList := l.rightQuery.compute(root, currentList, container)
rightComputedList := l.rightQuery.compute(root, currentList)
if len(rightComputedList) == 1 {
if _, ok := rightComputedList[0].(struct{}); ok {
return rightComputedList
Expand Down
4 changes: 2 additions & 2 deletions syntax_query_logical_not.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ type syntaxLogicalNot struct {
}

func (l *syntaxLogicalNot) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

computedList := l.query.compute(root, currentList, container)
computedList := l.query.compute(root, currentList)
var hasValue bool
for index := range computedList {
if _, ok := computedList[index].(struct{}); ok {
Expand Down
8 changes: 4 additions & 4 deletions syntax_query_logical_or.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ type syntaxLogicalOr struct {
}

func (l *syntaxLogicalOr) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

leftComputedList := l.leftQuery.compute(root, currentList, container)
leftComputedList := l.leftQuery.compute(root, currentList)
if len(leftComputedList) == 1 {
if _, ok := leftComputedList[0].(struct{}); ok {
return l.rightQuery.compute(root, currentList, container)
return l.rightQuery.compute(root, currentList)
}
return leftComputedList
}

rightComputedList := l.rightQuery.compute(root, currentList, container)
rightComputedList := l.rightQuery.compute(root, currentList)
if len(rightComputedList) == 1 {
if _, ok := rightComputedList[0].(struct{}); ok {
return leftComputedList
Expand Down
2 changes: 1 addition & 1 deletion syntax_query_param_current_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func (e *syntaxQueryParamCurrentRoot) isValueGroupParameter() bool {
}

func (e *syntaxQueryParamCurrentRoot) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

result := make([]interface{}, len(currentList))
containers := make([]bufferContainer, len(currentList))
Expand Down
2 changes: 1 addition & 1 deletion syntax_query_param_literal.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type syntaxQueryParamLiteral struct {
}

func (l *syntaxQueryParamLiteral) compute(
_ interface{}, _ []interface{}, _ *bufferContainer) []interface{} {
_ interface{}, _ []interface{}) []interface{} {

return l.literal
}
2 changes: 1 addition & 1 deletion syntax_query_param_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func (e *syntaxQueryParamRoot) isValueGroupParameter() bool {
}

func (e *syntaxQueryParamRoot) compute(
root interface{}, currentList []interface{}, container *bufferContainer) []interface{} {
root interface{}, currentList []interface{}) []interface{} {

values := bufferContainer{}

Expand Down

0 comments on commit b603109

Please sign in to comment.