From 0fbfa8ead04a59f3eef70f4f2e454e318d895bd9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 May 2016 18:51:31 +0200 Subject: Core/Containers: Warning fixes and RandomResizeList with predicate optimization --- src/common/Utilities/Containers.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/common/Utilities/Containers.h') diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 0f83b52f9d0..5edb245fd87 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -31,9 +31,9 @@ namespace Trinity namespace Containers { template - void RandomResizeList(std::list &list, uint32 size) + void RandomResizeList(std::list& list, uint32 size) { - size_t list_size = list.size(); + uint32 list_size = uint32(list.size()); while (list_size > size) { @@ -56,7 +56,7 @@ namespace Trinity if (size) RandomResizeList(listCopy, size); - list = listCopy; + list = std::move(listCopy); } /* @@ -68,7 +68,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; } @@ -170,7 +170,6 @@ namespace Trinity ++itr; } } - } //! namespace Containers } -- cgit v1.2.3