No need for a deque here.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36728 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-12-04 23:18:52 +00:00
parent 82b712c1fc
commit 9cce351940
2 changed files with 4 additions and 5 deletions

View File

@ -85,7 +85,7 @@ void LastFilesSection::add(FileName const & file)
LastFiles::iterator it = find(lastfiles.begin(), lastfiles.end(), file);
if (it != lastfiles.end())
lastfiles.erase(it);
lastfiles.push_front(file);
lastfiles.insert(lastfiles.begin(), file);
if (lastfiles.size() > num_lastfiles)
lastfiles.pop_back();
}

View File

@ -16,7 +16,6 @@
#include "support/FileName.h"
#include "support/types.h"
#include <deque>
#include <map>
#include <string>
#include <vector>
@ -58,7 +57,7 @@ class LastFilesSection : SessionSection
{
public:
///
typedef std::deque<support::FileName> LastFiles;
typedef std::vector<support::FileName> LastFiles;
public:
///
@ -70,10 +69,10 @@ public:
///
void write(std::ostream & os) const;
/// Return lastfiles container (deque)
/// Return lastfiles container (vector)
LastFiles const lastFiles() const { return lastfiles; }
/** Insert #file# into the lastfile dequeue.
/** Insert #file# into the lastfile vector.
This funtion inserts #file# into the last files list. If the file
already exists it is moved to the top of the list, else exist it
is placed on the top of the list. If the list is full the last