mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Change emptiness checks to empty() from size() [clang-tidy]
This has two benefits, it's clear what we are checking and size() isn't always constant time, where empty is (performance!)
This commit is contained in:
@@ -939,7 +939,7 @@ EQApplicationPacket *EQStream::PopPacket()
|
||||
EQRawApplicationPacket *p=nullptr;
|
||||
|
||||
MInboundQueue.lock();
|
||||
if (InboundQueue.size()) {
|
||||
if (!InboundQueue.empty()) {
|
||||
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
|
||||
p=*itr;
|
||||
InboundQueue.erase(itr);
|
||||
@@ -964,7 +964,7 @@ EQRawApplicationPacket *EQStream::PopRawPacket()
|
||||
EQRawApplicationPacket *p=nullptr;
|
||||
|
||||
MInboundQueue.lock();
|
||||
if (InboundQueue.size()) {
|
||||
if (!InboundQueue.empty()) {
|
||||
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
|
||||
p=*itr;
|
||||
InboundQueue.erase(itr);
|
||||
@@ -991,7 +991,7 @@ EQRawApplicationPacket *EQStream::PeekPacket()
|
||||
EQRawApplicationPacket *p=nullptr;
|
||||
|
||||
MInboundQueue.lock();
|
||||
if (InboundQueue.size()) {
|
||||
if (!InboundQueue.empty()) {
|
||||
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
|
||||
p=*itr;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ std::shared_ptr<EQStream> EQStreamFactory::Pop()
|
||||
{
|
||||
std::shared_ptr<EQStream> s = nullptr;
|
||||
MNewStreams.lock();
|
||||
if (NewStreams.size()) {
|
||||
if (!NewStreams.empty()) {
|
||||
s = NewStreams.front();
|
||||
NewStreams.pop();
|
||||
s->PutInUse();
|
||||
|
||||
Reference in New Issue
Block a user