summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/tcp_connection.cc
diff options
context:
space:
mode:
authorMarcus Müller <mueller@kit.edu>2018-02-20 15:47:12 +0100
committerMarcus Müller <marcus@hostalia.de>2018-02-23 19:06:50 +0100
commit2fc414578985b59c5bfbb15103f3c3677a1c6fdc (patch)
tree082f8be4333be7fa3264fdf09c30d61ce3ec033d /gr-blocks/lib/tcp_connection.cc
parent4cce1a032a929d72948d54c2b429dc8ebd530a36 (diff)
blocks: don't pmt::mp("string") for every single PDU
Replaced the usage of `#define PDU_PORT_ID pmt::mp("pdus")` – that was the actual way to *enforce* rehashing on every single use. Now, static const member of namespace `gr::blocks::pdu` as `s_pdu_port_id`. Should speed up the PDU blocks a bit. Removes run-time malloc'ing. Good thing.
Diffstat (limited to 'gr-blocks/lib/tcp_connection.cc')
-rw-r--r--gr-blocks/lib/tcp_connection.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gr-blocks/lib/tcp_connection.cc b/gr-blocks/lib/tcp_connection.cc
index 200e82b89f..4dba1e9edc 100644
--- a/gr-blocks/lib/tcp_connection.cc
+++ b/gr-blocks/lib/tcp_connection.cc
@@ -94,7 +94,7 @@ namespace gr {
pmt::pmt_t vector = pmt::init_u8vector(bytes_transferred, (const uint8_t*)&d_buf[0]);
pmt::pmt_t pdu = pmt::cons(pmt::PMT_NIL, vector);
- d_block->message_port_pub(PDU_PORT_ID, pdu);
+ d_block->message_port_pub(pdu::s_pdu_port_id, pdu);
}
d_socket.async_read_some(boost::asio::buffer(d_buf),