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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to