Core/Containers: Warning fixes and RandomResizeList with predicate optimization
This commit is contained in:
1 parent
0c6b29d466
commit
f11a9a31c2
1 file changed
+4
-4
@@ -30,9 +30,9 @@ namespace Trinity
|
||||
namespace Containers
|
||||
{
|
||||
template<class T>
|
||||
void RandomResizeList(std::list<T> &list, uint32 size)
|
||||
void RandomResizeList(std::list<T>& list, uint32 size)
|
||||
{
|
||||
size_t list_size = list.size();
|
||||
uint32 list_size = uint32(list.size());
|
||||
|
||||
while (list_size > size)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ namespace Trinity
|
||||
if (size)
|
||||
RandomResizeList(listCopy, size);
|
||||
|
||||
list = listCopy;
|
||||
list = std::move(listCopy);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -67,7 +67,7 @@ namespace Trinity
|
||||
typename C::value_type const& SelectRandomContainerElement(C const& container)
|
||||
{
|
||||
typename C::const_iterator it = container.begin();
|
||||
std::advance(it, urand(0, container.size() - 1));
|
||||
std::advance(it, urand(0, uint32(container.size()) - 1));
|
||||
return *it;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user