Repository: qpid-proton
Updated Branches:
  refs/heads/master b7e44c420 -> 64abf0616


NO-JIRA: go: minor cleanup in dispatch loop code.

needTick check did not need to be in inner loop.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/64abf061
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/64abf061
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/64abf061

Branch: refs/heads/master
Commit: 64abf0616817531fca0fbd4dfb2cce5cf8a89a2f
Parents: b7e44c4
Author: Alan Conway <[email protected]>
Authored: Thu Oct 6 11:08:38 2016 -0400
Committer: Alan Conway <[email protected]>
Committed: Thu Oct 6 11:08:38 2016 -0400

----------------------------------------------------------------------
 .../go/src/qpid.apache.org/proton/engine.go      | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/64abf061/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go 
b/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
index 7ba6827..7f1368e 100644
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
+++ b/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
@@ -251,18 +251,17 @@ func (eng *Engine) tick() {
 func (eng *Engine) dispatch() bool {
        var needTick bool // Set if we need to tick the transport.
        for {
-               if cevent := C.pn_connection_engine_dispatch(&eng.engine); 
cevent != nil {
-                       event := makeEvent(cevent, eng)
-                       for _, h := range eng.handlers {
-                               switch event.Type() {
-                               case ETransport:
-                                       needTick = true
-                               }
-                               h.HandleEvent(event)
-                       }
-               } else {
+               cevent := C.pn_connection_engine_dispatch(&eng.engine)
+               if cevent == nil {
                        break
                }
+               event := makeEvent(cevent, eng)
+               if event.Type() == ETransport {
+                       needTick = true
+               }
+               for _, h := range eng.handlers {
+                       h.HandleEvent(event)
+               }
        }
        if needTick {
                eng.tick()


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

Reply via email to