Fixed cppcheck (error) Iterator 'i' used after element has been erased

Status Job ID Name Coverage
  Test
passed #2693
Linux
clang-c++11-debug

00:00:18

passed #2695
Linux
clang-c++11-release

00:00:57

passed #2692
Linux
gcc-c++11-debug

00:00:23

passed #2694
Linux
gcc-c++11-release

00:00:58