From 3bb2dd5a81764c397e65c12eb5a3cc908782bcdf Mon Sep 17 00:00:00 2001 From: hsaturn Date: Sun, 28 Mar 2021 21:29:02 +0200 Subject: [PATCH] Code cleaning --- src/StringIndexer.h | 2 +- src/TinyMqtt.cpp | 2 +- src/TinyMqtt.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/StringIndexer.h b/src/StringIndexer.h index be93827..0c45f2a 100644 --- a/src/StringIndexer.h +++ b/src/StringIndexer.h @@ -104,7 +104,7 @@ class IndexedString const std::string& str() const { return StringIndexer::str(index); } - const StringIndexer::index_t getIndex() const { return index; } + const StringIndexer::index_t& getIndex() const { return index; } private: StringIndexer::index_t index; diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index 27cbac2..2b9464e 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -126,7 +126,7 @@ void MqttBroker::loop() // for(auto it=clients.begin(); it!=clients.end(); it++) // use index because size can change during the loop - for(int i=0; iconnected()) diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index 2a07a7f..664e3e8 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -160,7 +160,7 @@ class MqttClient Serial << "MqttClient (" << clientId.c_str() << ") p=" << (int32_t) parent << " c=" << (int32_t)client << (connected() ? " ON " : " OFF"); Serial << ", alive=" << (uint32_t)alive << '/' << ms << ", ka=" << keep_alive; - Serial << " cnx " << (client && client->connected()); + Serial << (client && client->connected() ? "" : "dis") << "connected"; message.hexdump("entrant msg"); bool c=false; Serial << " [";