Skip to content

Commit

Permalink
Fixed potentially undefined size_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimi1010 committed Nov 27, 2024
1 parent 2e24be2 commit 88f2b6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Common++/header/LRUList.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <list>
#include <cstddef>
#include <unordered_map>

#if __cplusplus > 199711L || _MSC_VER >= 1800
Expand All @@ -27,7 +28,7 @@ namespace pcpp

/// A c'tor for this class
/// @param[in] maxSize The max size this list can go
explicit LRUList(size_t maxSize)
explicit LRUList(std::size_t maxSize)
{
m_MaxSize = maxSize;
}
Expand Down Expand Up @@ -102,21 +103,21 @@ namespace pcpp
}

/// @return The max size of this list as determined in the c'tor
size_t getMaxSize() const
std::size_t getMaxSize() const
{
return m_MaxSize;
}

/// @return The number of elements currently in this list
size_t getSize() const
std::size_t getSize() const
{
return m_CacheItemsMap.size();
}

private:
std::list<T> m_CacheItemsList;
std::unordered_map<T, ListIterator> m_CacheItemsMap;
size_t m_MaxSize;
std::size_t m_MaxSize;
};

} // namespace pcpp

0 comments on commit 88f2b6e

Please sign in to comment.