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

View file

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

View file

@ -33,7 +33,6 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include <deque>
#include <functional> #include <functional>
#include <iterator> #include <iterator>
#include <list> #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 // 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 // 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; size_t i = 0;
for (auto const& e : new_subs->Events) { for (auto const& e : new_subs->Events) {
if (changes.count(&e)) 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["mode"] = selection_mode->GetSelection();
new_entry["selection"] = shifted_blocks; new_entry["selection"] = shifted_blocks;
history.push_front(new_entry); history.insert(history.begin(), new_entry);
if (history.size() > 50) if (history.size() > 50)
history.resize(50); history.resize(50);

View file

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

View file

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