From 3f1197855fc5575fd83533e6b2132b052c2517b2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 7 Nov 2018 20:27:22 +0100 Subject: Core/Utils: Avoid unneccessary container copy --- src/common/Utilities/Containers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/Utilities/Containers.h') diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 581fbfabe6b..fb952c89b24 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -102,7 +102,7 @@ namespace Trinity * Note: container cannot be empty */ template - inline auto SelectRandomWeightedContainerElement(C const& container, std::vector weights) -> decltype(std::begin(container)) + inline auto SelectRandomWeightedContainerElement(C const& container, std::vector const& weights) -> decltype(std::begin(container)) { auto it = std::begin(container); std::advance(it, urandweighted(weights.size(), weights.data())); -- cgit v1.2.3