You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2016/08/06 11:39:33 UTC

qpid-proton git commit: PROTON-1274: avoid costly event context lookup

Repository: qpid-proton
Updated Branches:
  refs/heads/master 6f87c1cd1 -> 7e8e78d0e


PROTON-1274: avoid costly event context lookup


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

Branch: refs/heads/master
Commit: 7e8e78d0ebc14955aad5b2de0ff32360b1f6adf5
Parents: 6f87c1c
Author: Ken Giusti <kg...@apache.org>
Authored: Fri Aug 5 15:33:43 2016 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Sat Aug 6 07:30:04 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/proton/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7e8e78d0/proton-c/bindings/python/proton/__init__.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/__init__.py b/proton-c/bindings/python/proton/__init__.py
index d7db20b..25afa44 100644
--- a/proton-c/bindings/python/proton/__init__.py
+++ b/proton-c/bindings/python/proton/__init__.py
@@ -3890,7 +3890,10 @@ class Event(Wrapper, EventBase):
 
     event = Event(impl, number)
 
-    if isinstance(event.context, EventBase):
+    # check for an application defined ApplicationEvent and return that.  This
+    # avoids an expensive wrap operation invoked by event.context
+    if pn_event_class(impl) == PN_PYREF and \
+       isinstance(event.context, EventBase):
       return event.context
     else:
       return event


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org