Change most uses of deques to vectors

This commit is contained in:
Thomas Goyne 2014-05-25 08:00:36 -07:00
parent 20a7ec786f
commit 8ec9280ecc
7 changed files with 15 additions and 18 deletions

View File

@ -9,14 +9,13 @@ Author: Terry Caton
#pragma once
#include <cstdint>
#include <deque>
#include <map>
#include <memory>
#include <string>
#include <stdexcept>
#include <vector>
namespace json
{
namespace json {
/////////////////////////////////////////////////
// forward declarations (more info further below)
@ -28,7 +27,7 @@ typedef int64_t Integer;
typedef double Double;
typedef bool Boolean;
typedef std::string String;
typedef std::deque<UnknownElement> Array;
typedef std::vector<UnknownElement> Array;
typedef std::map<std::string, UnknownElement> Object;
struct Null;

View File

@ -17,16 +17,16 @@
/// @ingroup libaegisub
#include <boost/filesystem/path.hpp>
#include <deque>
#include <list>
#include <map>
#include <vector>
#include <libaegisub/exception.h>
#include <libaegisub/fs_fwd.h>
namespace json {
class UnknownElement;
typedef std::deque<UnknownElement> Array;
typedef std::vector<UnknownElement> Array;
}
namespace agi {

View File

@ -33,7 +33,6 @@
#endif
#include <algorithm>
#include <deque>
#include <functional>
#include <iterator>
#include <list>

View File

@ -107,7 +107,7 @@ void AsyncVideoProvider::UpdateSubtitles(const AssFile *new_subs, std::set<const
// Copy just the lines which were changed, then replace the lines at the
// same indices in the worker's copy of the file with the new entries
std::deque<std::pair<size_t, AssDialogue*>> changed;
std::vector<std::pair<size_t, AssDialogue*>> changed;
size_t i = 0;
for (auto const& e : new_subs->Events) {
if (changes.count(&e))

View File

@ -315,7 +315,7 @@ void DialogShiftTimes::SaveHistory(json::Array const& shifted_blocks) {
new_entry["mode"] = selection_mode->GetSelection();
new_entry["selection"] = shifted_blocks;
history.push_front(new_entry);
history.insert(history.begin(), new_entry);
if (history.size() > 50)
history.resize(50);

View File

@ -38,7 +38,6 @@
#include <algorithm>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <deque>
#include <vector>
#include <wx/app.h>
#include <wx/frame.h>
@ -114,13 +113,13 @@ public:
/// handlers makes everything involves events unusably slow.
class CommandManager {
/// Menu items which need to do something on menu open
std::deque<std::pair<std::string, wxMenuItem*>> dynamic_items;
std::vector<std::pair<std::string, wxMenuItem*>> dynamic_items;
/// Menu items which need to be updated only when hotkeys change
std::deque<std::pair<std::string, wxMenuItem*>> static_items;
std::vector<std::pair<std::string, wxMenuItem*>> static_items;
/// window id -> command map
std::vector<std::string> items;
/// MRU menus which need to be updated on menu open
std::deque<MruMenu*> mru;
std::vector<MruMenu*> mru;
/// Project context
agi::Context *context;

View File

@ -17,15 +17,15 @@
/// @see preferences.cpp
/// @ingroup configuration_ui
#include <deque>
#include <libaegisub/exception.h>
#include <functional>
#include <map>
#include <memory>
#include <vector>
#include <wx/dialog.h>
#include <libaegisub/exception.h>
class wxButton;
class wxTreebook;
namespace agi { class OptionValue; }
@ -42,8 +42,8 @@ private:
wxButton *applyButton;
std::map<std::string, std::unique_ptr<agi::OptionValue>> pending_changes;
std::deque<Thunk> pending_callbacks;
std::deque<std::string> option_names;
std::vector<Thunk> pending_callbacks;
std::vector<std::string> option_names;
void OnOK(wxCommandEvent &);
void OnCancel(wxCommandEvent &);