diff options
-rw-r--r-- | src/common/Utilities/Containers.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index e45bfa5cdbc..c43012e6d73 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; } |