Skip to content

Commit a98d04c

Browse files
Use isNotEmpty() instead of !isEmpty()
1 parent 9dc4f19 commit a98d04c

28 files changed

+52
-27
lines changed

src/modm/communication/rpr/interface_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ template <typename Device, std::size_t N>
467467
void
468468
modm::rpr::Interface<Device, N>::popMessage(Queue &queue)
469469
{
470-
if (!queue.isEmpty())
470+
if (queue.isNotEmpty())
471471
{
472472
// deallocate the external buffer
473473
Message message = queue.get();

src/modm/communication/xpcc/backend/can/connector_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ xpcc::CanConnector<Driver>::sendWaitingMessages()
123123
}
124124
else if (canDriver->getBusState() != Driver::BusState::Connected) {
125125
// No connection to the CAN bus, drop all messages which should be send
126-
while (!sendList.isEmpty()) {
126+
while (sendList.isNotEmpty()) {
127127
sendList.removeFront();
128128
}
129129
return;

src/modm/container/doubly_linked_list.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ namespace modm
4242
inline bool
4343
isEmpty() const;
4444

45+
inline bool
46+
isNotEmpty() const { return (not isEmpty()); }
47+
4548
/**
4649
* \brief Get number of items in the list
4750
*

src/modm/container/dynamic_array.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ namespace modm
104104
return (this->size == 0);
105105
}
106106

107+
inline bool
108+
isNotEmpty() const
109+
{
110+
return not isEmpty();
111+
}
112+
107113
/**
108114
* \brief Return size
109115
*

src/modm/container/linked_list.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ namespace modm
5050
inline bool
5151
isEmpty() const;
5252

53+
inline bool
54+
isNotEmpty() const { return (not isEmpty()); }
55+
5356
/**
5457
* \brief Get number of elements
5558
*

src/modm/container/linked_list_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ template <typename T, typename Allocator>
179179
void
180180
modm::LinkedList<T, Allocator>::removeAll()
181181
{
182-
while (!this->isEmpty()) {
182+
while (this->isNotEmpty()) {
183183
this->removeFront();
184184
}
185185
}

src/modm/container/stack.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ namespace modm
4747
return c.isEmpty();
4848
}
4949

50+
inline bool
51+
isNotEmpty()
52+
{
53+
return not c.isEmpty();
54+
}
55+
5056
bool
5157
isFull()
5258
{

src/modm/platform/can/lpc/c_can.cpp.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ modm::platform::Can::CAN_tx(uint8_t /* msg_obj_num */)
162162
// All message objects empty. Otherwise the order of messages
163163
// is not maintained
164164

165-
while (!txQueue.isEmpty())
165+
while (txQueue.isNotEmpty())
166166
{
167167
// Still messages in the queue.
168168

@@ -349,7 +349,7 @@ bool
349349
modm::platform::Can::isMessageAvailable()
350350
{
351351
%% if options["buffer.rx"] > 0
352-
return !rxQueue.isEmpty();
352+
return rxQueue.isNotEmpty();
353353
%% else
354354
/* Check if new data is available in the Message
355355
* Objects 1 to 16. */

src/modm/platform/i2c/stm32/i2c_master.cpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ modm::platform::I2cMaster{{ id }}::reset()
622622
if (transaction) transaction->detaching(DetachCause::ErrorCondition);
623623
transaction = nullptr;
624624
// remove all queued transactions
625-
while(!queue.isEmpty())
625+
while(queue.isNotEmpty())
626626
{
627627
ConfiguredTransaction next = queue.get();
628628
if (next.transaction) next.transaction->detaching(DetachCause::ErrorCondition);

src/modm/platform/uart/at90_tiny_mega/uart_rx.cpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ std::size_t
101101
modm::platform::Uart{{ id }}::discardReceiveBuffer()
102102
{
103103
std::size_t i(0);
104-
while(!rxBuffer.isEmpty())
104+
while(rxBuffer.isNotEmpty())
105105
{
106106
rxBuffer.pop();
107107
++i;

0 commit comments

Comments
 (0)