Sorry, wasn't clear. It's not lineno calculation that I'm wondering about. It's that the same value of lineno is used as an index into the map on both sides of the assignment. So it is just setting the map entry to its existing value. This does nothing.cenix wrote:Correct, but if you scroll up a couple of lines (to line 213), you see that that is done.
This, because I use lineno a couple of times, so calculating a new lineno is only done once.
That's why I was wondering if you are trying to propagate the LineInfo from the previous line to the next line. In that case you would want to say something like this:
Code: Select all
std::map<int, LineInfo>::iterator iter = m_lineInfo.find(lineno);
if (iter != m_lineInfo.end()) {
m_lineInfo[lineno+1] = iter->second;
}