mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #736 from TETYYS/message-limit-fix
Changed LimitedQueue::space() to signed value, eliminating underflows
This commit is contained in:
commit
d79a8b81b1
|
@ -32,7 +32,7 @@ protected:
|
|||
typedef std::shared_ptr<std::vector<Chunk>> ChunkVector;
|
||||
|
||||
public:
|
||||
LimitedQueue(int limit = 1000)
|
||||
LimitedQueue(size_t limit = 1000)
|
||||
: limit_(limit)
|
||||
{
|
||||
this->clear();
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
}
|
||||
|
||||
// create new chunk for the first one
|
||||
size_t offset = std::min(this->space(), items.size());
|
||||
size_t offset = std::min(this->space(), static_cast<qsizetype>(items.size()));
|
||||
Chunk newFirstChunk = std::make_shared<std::vector<T>>();
|
||||
newFirstChunk->resize(this->chunks_->front()->size() + offset);
|
||||
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
size_t space()
|
||||
qsizetype space()
|
||||
{
|
||||
size_t totalSize = 0;
|
||||
for (Chunk &chunk : *this->chunks_) {
|
||||
|
|
Loading…
Reference in a new issue