+ // Remove element if it was already present. Iterating should
+ // not be a problem since the list is small (<100 elements).
+ for (FilePosList::iterator it = lastfilepos.begin();
+ it != lastfilepos.end(); ++it)
+ if (it->file == pos.file) {
+ lastfilepos.erase(it);
+ break;
+ }
+
+ // insert new element at front.
+ lastfilepos.push_front(pos);