aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/Utilities/Containers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h
index dfd37f69d62..ca4a00e4c29 100644
--- a/src/common/Utilities/Containers.h
+++ b/src/common/Utilities/Containers.h
@@ -68,7 +68,8 @@ namespace Trinity
// this element has chance (elementsToKeep / elementsToProcess) of being kept
if (urand(1, elementsToProcess) <= elementsToKeep)
{
- *keepIt = std::move(*curIt);
+ if (keepIt != curIt)
+ *keepIt = std::move(*curIt);
++keepIt;
--elementsToKeep;
}