You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2022/05/13 14:24:13 UTC

[qpid-proton] 09/09: PROTON-2542: Remove last vestiges of now unnecessary "reify" operation

This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 005789172947c2e567ddbc6e8a8c783951313fd9
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Tue May 3 17:58:18 2022 -0400

    PROTON-2542: Remove last vestiges of now unnecessary "reify" operation
    
    We have now removed every previous case that relied on the object system
    looking up the actual class of an object and this is now entirely
    delegated to the objct classes themselves. This means we can remove the
    generic code that looks up the object class in all of the general paths.
---
 c/src/core/event.c         |  4 ----
 c/src/core/object/object.c | 21 ---------------------
 2 files changed, 25 deletions(-)

diff --git a/c/src/core/event.c b/c/src/core/event.c
index 1fa62d9d..3f81f707 100644
--- a/c/src/core/event.c
+++ b/c/src/core/event.c
@@ -167,10 +167,6 @@ pn_event_t *pn_collector_put(pn_collector_t *collector,
     collector->head = event;
   }
 
-  if (clazz==PN_OBJECT) {
-    clazz = pn_class(context);
-  }
-
   event->clazz = clazz;
   event->context = context;
   event->type = type;
diff --git a/c/src/core/object/object.c b/c/src/core/object/object.c
index b5296063..318b3d95 100644
--- a/c/src/core/object/object.c
+++ b/c/src/core/object/object.c
@@ -162,9 +162,6 @@ void *pn_class_new(const pn_class_t *clazz, size_t size)
 void *pn_class_incref(const pn_class_t *clazz, void *object)
 {
   if (object) {
-    if (clazz==PN_OBJECT) {
-      clazz = pni_head(object)->clazz;
-    }
     pni_class_incref(clazz, object);
   }
   return object;
@@ -172,19 +169,12 @@ void *pn_class_incref(const pn_class_t *clazz, void *object)
 
 int pn_class_refcount(const pn_class_t *clazz, void *object)
 {
-  if (clazz==PN_OBJECT) {
-    clazz = pn_class(object);
-  }
-
   return pni_class_refcount(clazz, object);
 }
 
 int pn_class_decref(const pn_class_t *clazz, void *object)
 {
   if (object) {
-    if (clazz==PN_OBJECT) {
-      clazz = pni_head(object)->clazz;
-    }
     pni_class_decref(clazz, object);
     int rc = pni_class_refcount(clazz, object);
     if (rc == 0) {
@@ -209,10 +199,6 @@ int pn_class_decref(const pn_class_t *clazz, void *object)
 void pn_class_free(const pn_class_t *clazz, void *object)
 {
   if (object) {
-    if (clazz==PN_OBJECT) {
-      clazz = pni_head(object)->clazz;
-    }
-
     int rc = pni_class_refcount(clazz, object);
     assert(rc == 1 || rc == -1);
     if (rc == 1) {
@@ -232,9 +218,6 @@ intptr_t pn_class_compare(const pn_class_t *clazz, void *a, void *b)
   if (a == b) return 0;
 
   if (a && b) {
-    if (clazz==PN_OBJECT) {
-      clazz = pni_head(a)->clazz;
-    }
     if (clazz->compare) {
       return clazz->compare(a, b);
     }
@@ -249,10 +232,6 @@ bool pn_class_equals(const pn_class_t *clazz, void *a, void *b)
 
 int pn_class_inspect(const pn_class_t *clazz, void *object, pn_string_t *dst)
 {
-  if (clazz==PN_OBJECT) {
-      clazz = pni_head(object)->clazz;
-  }
-
   if (!pn_string_get(dst)) {
     pn_string_set(dst, "");
   }


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