Branch: refs/heads/2.1.0
Home:
https://github.com/tribe29/checkmk
Commit: 9c956f145e3ac90eaa6ff8bdbb8a723af5a08c39
https://github.com/tribe29/checkmk/commit/9c956f145e3ac90eaa6ff8bdbb8a723af…
Author: Sergey Kipnis <sergey.kipnis(a)tribe29.com>
Date: 2022-06-29 (Wed, 29 Jun 2022)
Changed paths:
M livestatus/src/Logfile.cc
Log Message:
-----------
Fix erasing by iterator in loop containers
To erase an element by iterator and keep iterator valid,
we must always use
`it = container.erase(it);`
See cppreference and/or Meyers.
The method `container.erase(it++)` for _looping_ container
doesn't work(verified in goldbolt).
- add TODO to the erasing in the map container: probably,
we should use unified method to erase from containers.
It is not clear why Meyers recommends to use post-++ instead
of the defined by C++ standard return value from the erase().
Change-Id: I350168c0c3f6877fb5886ba40603a0da77eecfdd