[gnote] Replace std::list with std::vector in notetag



commit abc475fa9079bc9fbae2e19fcc50e4bdba5c4777
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Apr 20 15:06:41 2019 +0300

    Replace std::list with std::vector in notetag

 src/notetag.cpp | 5 +++--
 src/notetag.hpp | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/notetag.cpp b/src/notetag.cpp
index 2e366425..08de7a8a 100644
--- a/src/notetag.cpp
+++ b/src/notetag.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011,2013-2014,2017 Aurimas Cernius
+ * Copyright (C) 2011,2013-2014,2017,2019 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -28,6 +28,7 @@
 #include "debug.hpp"
 #include "notetag.hpp"
 #include "noteeditor.hpp"
+#include "utils.hpp"
 
 namespace gnote {
 
@@ -624,7 +625,7 @@ namespace gnote {
   
   void NoteTagTable::on_tag_removed(const Glib::RefPtr<Gtk::TextTag> & tag)
   {
-    m_added_tags.remove(tag);
+    utils::remove_swap_back(m_added_tags, tag);
 
     NoteTag::Ptr note_tag = NoteTag::Ptr::cast_dynamic(tag);
     if (note_tag) {
diff --git a/src/notetag.hpp b/src/notetag.hpp
index 03918461..8a92253a 100644
--- a/src/notetag.hpp
+++ b/src/notetag.hpp
@@ -328,7 +328,7 @@ private:
 
   static NoteTagTable::Ptr           s_instance;
   std::map<Glib::ustring, Factory>   m_tag_types;
-  std::list<Glib::RefPtr<Gtk::TextTag> > m_added_tags;
+  std::vector<Glib::RefPtr<Gtk::TextTag> > m_added_tags;
 
   NoteTag::Ptr m_url_tag;
   NoteTag::Ptr m_link_tag;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]