You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/11/02 02:53:32 UTC
[12/50] [abbrv] qpid-proton git commit: NO-JIRA: go: minor cleanup in
dispatch loop code.
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/go1
Commit: 64abf0616817531fca0fbd4dfb2cce5cf8a89a2f
Parents: b7e44c4
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Oct 6 11:08:38 2016 -0400
Committer: Alan Conway <ac...@redhat.com>
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: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org