From 280c182e676146718d2c4cdf056dfff857c3685c Mon Sep 17 00:00:00 2001
From: Josh Finken <392585+jfinken@users.noreply.github.com>
Date: Tue, 12 Dec 2023 15:39:37 -0700
Subject: [PATCH] Do not call get_non_local_subscription_count (#138)

Use the previous mechanism, and do not call that method but leave
it in the codebase.
---
 rclcpp/include/rclcpp/publisher.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rclcpp/include/rclcpp/publisher.hpp b/rclcpp/include/rclcpp/publisher.hpp
index 5f713359a0..5ed7b6e320 100644
--- a/rclcpp/include/rclcpp/publisher.hpp
+++ b/rclcpp/include/rclcpp/publisher.hpp
@@ -237,7 +237,7 @@ class Publisher : public PublisherBase
     // It's not possible to do that with an unique_ptr,
     // as do_intra_process_publish takes the ownership of the message.
     bool inter_process_publish_needed =
-      get_non_local_subscription_count() > 0;
+        get_subscription_count() > get_intra_process_subscription_count();
 
     if (inter_process_publish_needed) {
       auto shared_msg =
@@ -306,7 +306,7 @@ class Publisher : public PublisherBase
     }
 
     bool inter_process_publish_needed =
-      get_non_local_subscription_count() > 0;
+        get_subscription_count() > get_intra_process_subscription_count();
 
     if (inter_process_publish_needed) {
       ROSMessageType ros_msg;