You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/09/01 14:15:23 UTC

[GitHub] [dubbo-go] gaoxinge commented on a change in pull request #722: fix exporter append

gaoxinge commented on a change in pull request #722:
URL: https://github.com/apache/dubbo-go/pull/722#discussion_r481170045



##########
File path: protocol/protocolwrapper/protocol_filter_wrapper.go
##########
@@ -68,21 +68,16 @@ func (pfw *ProtocolFilterWrapper) Destroy() {
 }
 
 func buildInvokerChain(invoker protocol.Invoker, key string) protocol.Invoker {
-	filtName := invoker.GetUrl().GetParam(key, "")
-	if filtName == "" {
-		return invoker
-	}
-	filtNames := strings.Split(filtName, ",")
-	next := invoker
+	filterName := invoker.GetUrl().GetParam(key, "")
+	filterNames := strings.Split(filterName, ",")
 
 	// The order of filters is from left to right, so loading from right to left
-
-	for i := len(filtNames) - 1; i >= 0; i-- {
-		flt := extension.GetFilter(filtNames[i])
+	next := invoker
+	for i := len(filterNames) - 1; i >= 0; i-- {

Review comment:
       If `filterName` equals `""`, then `filterNames` will equal to `[]`. Then because `filterNames` is empty string slice, and `len(filterNames)` equals zero, the circle will return immediately.

##########
File path: protocol/protocolwrapper/protocol_filter_wrapper.go
##########
@@ -68,21 +68,16 @@ func (pfw *ProtocolFilterWrapper) Destroy() {
 }
 
 func buildInvokerChain(invoker protocol.Invoker, key string) protocol.Invoker {
-	filtName := invoker.GetUrl().GetParam(key, "")
-	if filtName == "" {

Review comment:
       If filterName equals "", then filterNames will equal to []. Then because filterNames is empty string slice, and len(filterNames) equals zero, the circle will return immediately.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org