From b603109ea1e4a717c6aea090b993267f5fd85779 Mon Sep 17 00:00:00 2001 From: Asai Yusuke Date: Sun, 22 Jan 2023 22:50:57 +0900 Subject: [PATCH] remove unused parameter (#18) --- syntax_basic_compare_parameter.go | 4 ++-- syntax_basic_compare_query.go | 6 +++--- syntax_if_query.go | 2 +- syntax_node_qualifier_filter.go | 4 ++-- syntax_query_logical_and.go | 8 ++++---- syntax_query_logical_not.go | 4 ++-- syntax_query_logical_or.go | 8 ++++---- syntax_query_param_current_root.go | 2 +- syntax_query_param_literal.go | 2 +- syntax_query_param_root.go | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/syntax_basic_compare_parameter.go b/syntax_basic_compare_parameter.go index a2c72c8..5f2bf2e 100644 --- a/syntax_basic_compare_parameter.go +++ b/syntax_basic_compare_parameter.go @@ -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) } diff --git a/syntax_basic_compare_query.go b/syntax_basic_compare_query.go index 221254a..d467ac4 100644 --- a/syntax_basic_compare_query.go +++ b/syntax_basic_compare_query.go @@ -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 { diff --git a/syntax_if_query.go b/syntax_if_query.go index 8316ad0..ddaeaa8 100644 --- a/syntax_if_query.go +++ b/syntax_if_query.go @@ -1,5 +1,5 @@ package jsonpath type syntaxQuery interface { - compute(root interface{}, currentList []interface{}, container *bufferContainer) []interface{} + compute(root interface{}, currentList []interface{}) []interface{} } diff --git a/syntax_node_qualifier_filter.go b/syntax_node_qualifier_filter.go index e6e86c7..56cd41f 100644 --- a/syntax_node_qualifier_filter.go +++ b/syntax_node_qualifier_filter.go @@ -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) @@ -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) diff --git a/syntax_query_logical_and.go b/syntax_query_logical_and.go index 658e420..61f82a9 100644 --- a/syntax_query_logical_and.go +++ b/syntax_query_logical_and.go @@ -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 diff --git a/syntax_query_logical_not.go b/syntax_query_logical_not.go index 9efaeeb..abf15ec 100644 --- a/syntax_query_logical_not.go +++ b/syntax_query_logical_not.go @@ -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 { diff --git a/syntax_query_logical_or.go b/syntax_query_logical_or.go index 729b142..06aa01c 100644 --- a/syntax_query_logical_or.go +++ b/syntax_query_logical_or.go @@ -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 diff --git a/syntax_query_param_current_root.go b/syntax_query_param_current_root.go index 557cf4f..d916fe4 100644 --- a/syntax_query_param_current_root.go +++ b/syntax_query_param_current_root.go @@ -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)) diff --git a/syntax_query_param_literal.go b/syntax_query_param_literal.go index 76e10fc..0ff25a5 100644 --- a/syntax_query_param_literal.go +++ b/syntax_query_param_literal.go @@ -5,7 +5,7 @@ type syntaxQueryParamLiteral struct { } func (l *syntaxQueryParamLiteral) compute( - _ interface{}, _ []interface{}, _ *bufferContainer) []interface{} { + _ interface{}, _ []interface{}) []interface{} { return l.literal } diff --git a/syntax_query_param_root.go b/syntax_query_param_root.go index 6f0bbc5..4d5dfa9 100644 --- a/syntax_query_param_root.go +++ b/syntax_query_param_root.go @@ -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{}