[glom] C++11: Use std::unordered_map instead of std::map.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: Use std::unordered_map instead of std::map.
- Date: Sun, 6 Nov 2016 19:19:28 +0000 (UTC)
commit 3c226b79a777b7808b7bb5e8426c33f44af10af6
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Nov 6 11:39:06 2016 +0100
C++11: Use std::unordered_map instead of std::map.
glom/bakery/busy_cursor.h | 4 ++--
glom/base_db.h | 4 ++--
glom/base_db_table_data.cc | 2 +-
glom/import_csv/dialog_import_csv_progress.h | 2 +-
glom/libglom/connectionpool_backends/sqlite.h | 2 +-
glom/libglom/data_structure/field.h | 8 ++++----
glom/libglom/data_structure/fieldtypes.h | 6 +++---
glom/libglom/data_structure/groupinfo.h | 4 ++--
.../layout/report_parts/layoutitem_groupby.h | 2 +-
glom/libglom/data_structure/translatable_item.h | 4 ++--
glom/libglom/db_utils.h | 2 +-
glom/libglom/document/document.h | 6 +++---
glom/libglom/privs.h | 4 ++--
glom/libglom/python_embed/py_glom_record.h | 2 +-
glom/libglom/python_embed/py_glom_related.h | 4 ++--
glom/libglom/python_embed/py_glom_relatedrecord.h | 2 +-
glom/mode_data/box_data_calendar_related.h | 8 ++++++++
glom/mode_data/datawidget/combo_as_radio_buttons.h | 2 +-
glom/mode_data/datawidget/treemodel_db.h | 4 ++--
glom/mode_data/db_adddel/db_adddel.h | 2 +-
glom/mode_data/flowtablewithfields.h | 2 +-
glom/mode_design/iso_codes.cc | 6 +++---
.../relationships_overview/canvas_group_dbtable.h | 2 +-
.../window_relationships_overview.h | 4 ++--
glom/print_layout/canvas_print_layout.cc | 2 +-
glom/python_embed/glom_python.h | 2 +-
glom/utility_widgets/adddel/adddel.h | 2 +-
glom/utility_widgets/canvas/canvas_editable.h | 2 +-
glom/variablesmap.h | 4 ++--
29 files changed, 54 insertions(+), 46 deletions(-)
---
diff --git a/glom/bakery/busy_cursor.h b/glom/bakery/busy_cursor.h
index 20752ba..06342a9 100644
--- a/glom/bakery/busy_cursor.h
+++ b/glom/bakery/busy_cursor.h
@@ -21,7 +21,7 @@
#include <gtkmm/window.h>
#include <gdkmm/cursor.h>
-#include <map>
+#include <unordered_map>
namespace Glom
{
@@ -50,7 +50,7 @@ private:
Gtk::Window* m_window;
Glib::RefPtr<Gdk::Window> m_gdk_window;
- typedef std::map<Gtk::Window*, Glib::RefPtr<Gdk::Cursor> > type_map_cursors;
+ typedef std::unordered_map<Gtk::Window*, Glib::RefPtr<Gdk::Cursor> > type_map_cursors;
static type_map_cursors m_map_cursors;
Glib::RefPtr<Gdk::Cursor> m_old_cursor;
};
diff --git a/glom/base_db.h b/glom/base_db.h
index 7f4b565..87a94b1 100644
--- a/glom/base_db.h
+++ b/glom/base_db.h
@@ -224,7 +224,7 @@ protected:
*/
void do_calculations(const LayoutFieldInRecord& field_changed, bool first_calc_field);
- typedef std::map<Glib::ustring, CalcInProgress> type_field_calcs;
+ typedef std::unordered_map<Glib::ustring, CalcInProgress, std::hash<std::string>> type_field_calcs;
/** Get the fields whose values should be recalculated when @a field_name changes.
@@ -240,7 +240,7 @@ protected:
void calculate_field_in_all_records(const Glib::ustring& table_name, const std::shared_ptr<const Field>&
field);
void calculate_field_in_all_records(const Glib::ustring& table_name, const std::shared_ptr<const Field>&
field, const std::shared_ptr<const Field>& primary_key);
- typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_fields;
+ typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_map_fields;
//TODO: Performance: This is massively inefficient:
type_map_fields get_record_field_values_for_calculation(const Glib::ustring& table_name, const
std::shared_ptr<const Field>& primary_key, const Gnome::Gda::Value& primary_key_value);
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index b66e5e1..2056b6c 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -88,7 +88,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
builder->set_table(m_table_name);
//Avoid specifying the same field twice:
- typedef std::map<Glib::ustring, bool> type_map_added;
+ typedef std::unordered_map<Glib::ustring, bool, std::hash<std::string>> type_map_added;
type_map_added map_added;
auto params = Gnome::Gda::Set::create();
diff --git a/glom/import_csv/dialog_import_csv_progress.h b/glom/import_csv/dialog_import_csv_progress.h
index 489593b..5eac744 100644
--- a/glom/import_csv/dialog_import_csv_progress.h
+++ b/glom/import_csv/dialog_import_csv_progress.h
@@ -72,7 +72,7 @@ private:
// We use this for implementing get_entered_field_data and
// set_entered_field_data, required by Base_DB_Table_Data::record_new().
// It just holds the values for the fields in the current row.
- typedef std::map<Glib::ustring, Gnome::Gda::Value> type_mapValues;
+ typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_mapValues;
type_mapValues m_current_row_values;
Gtk::ProgressBar* m_progress_bar;
diff --git a/glom/libglom/connectionpool_backends/sqlite.h b/glom/libglom/connectionpool_backends/sqlite.h
index 430ab65..99b7e27 100644
--- a/glom/libglom/connectionpool_backends/sqlite.h
+++ b/glom/libglom/connectionpool_backends/sqlite.h
@@ -47,7 +47,7 @@ private:
typedef std::vector<Glib::ustring> type_vec_strings;
//typedef std::vector<std::shared_ptr<const Field> > type_vec_fields;
- typedef std::map<Glib::ustring, std::shared_ptr<const Field> > type_mapFieldChanges;
+ typedef std::unordered_map<Glib::ustring, std::shared_ptr<const Field>, std::hash<std::string>>
type_mapFieldChanges;
bool recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connection, const Glib::ustring&
table_name, const type_vec_strings& fields_removed, const type_vec_const_fields& fields_added, const
type_mapFieldChanges& fields_changed) noexcept;
diff --git a/glom/libglom/data_structure/field.h b/glom/libglom/data_structure/field.h
index 84defde..2fc11df 100644
--- a/glom/libglom/data_structure/field.h
+++ b/glom/libglom/data_structure/field.h
@@ -195,7 +195,7 @@ public:
void set_visible(bool val = true);
bool get_visible() const;
- typedef std::map<glom_field_type, Glib::ustring> type_map_type_names;
+ typedef std::unordered_map<glom_field_type, Glib::ustring> type_map_type_names;
/// Get canonical type names for internal use, such as in the XML of the document.
static type_map_type_names get_type_names();
@@ -226,15 +226,15 @@ private:
GType get_gda_data_type_with_fallback(const Gnome::Gda::Value& value);
//The glom type to be used for the gda type:
- typedef std::map<GType, glom_field_type> type_map_gda_type_to_glom_type;
+ typedef std::unordered_map<GType, glom_field_type> type_map_gda_type_to_glom_type;
static type_map_gda_type_to_glom_type m_map_gda_type_to_glom_type;
//The gda type to be used for the glom type:
- typedef std::map<glom_field_type, GType> type_map_glom_type_to_gda_type;
+ typedef std::unordered_map<glom_field_type, GType> type_map_glom_type_to_gda_type;
static type_map_glom_type_to_gda_type m_map_glom_type_to_gda_type;
typedef std::vector<glom_field_type> type_list_conversion_targets;
- typedef std::map<glom_field_type, type_list_conversion_targets> type_map_conversions;
+ typedef std::unordered_map<glom_field_type, type_list_conversion_targets> type_map_conversions;
static type_map_type_names m_map_type_names; //These are canonical, for internal use.
static type_map_type_names m_map_type_names_ui; //These are translated.
diff --git a/glom/libglom/data_structure/fieldtypes.h b/glom/libglom/data_structure/fieldtypes.h
index 5723f9b..a8a9c1b 100644
--- a/glom/libglom/data_structure/fieldtypes.h
+++ b/glom/libglom/data_structure/fieldtypes.h
@@ -23,7 +23,7 @@
#define GLOM_DATASTRUCTURE_FIELDTYPES_H
#include <libgdamm/connection.h>
-#include <map>
+#include <unordered_map>
namespace Glom
{
@@ -48,11 +48,11 @@ private:
void fill_with_default_data();
//Duplicate information, to make searching easier:
- typedef std::map<GType, Glib::ustring> type_mapGdaTypesToSchemaStrings;
+ typedef std::unordered_map<GType, Glib::ustring> type_mapGdaTypesToSchemaStrings;
type_mapGdaTypesToSchemaStrings m_mapGdaTypesToSchemaStrings;
//Fallback types used if the database system does not support a type natively
- typedef std::map<GType, GType> type_mapFallbackTypes;
+ typedef std::unordered_map<GType, GType> type_mapFallbackTypes;
type_mapFallbackTypes m_mapFallbackTypes;
};
diff --git a/glom/libglom/data_structure/groupinfo.h b/glom/libglom/data_structure/groupinfo.h
index be4a343..1b00fc0 100644
--- a/glom/libglom/data_structure/groupinfo.h
+++ b/glom/libglom/data_structure/groupinfo.h
@@ -23,7 +23,7 @@
#include <libglom/data_structure/translatable_item.h>
#include <libglom/data_structure/privileges.h>
-#include <map>
+#include <unordered_map>
namespace Glom
{
@@ -43,7 +43,7 @@ public:
bool m_developer; //m_privs is ignored if this is true.
- typedef std::map<Glib::ustring, Privileges> type_map_table_privileges;
+ typedef std::unordered_map<Glib::ustring, Privileges, std::hash<std::string>> type_map_table_privileges;
type_map_table_privileges m_map_privileges;
//typedef std::vector<Glib::ustring> type_users;
diff --git a/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
b/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
index 12db52c..dfa0c30 100644
--- a/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
+++ b/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
@@ -23,7 +23,7 @@
#include <libglom/data_structure/layout/layoutgroup.h>
#include <libglom/data_structure/layout/layoutitem_field.h>
-#include <map>
+#include <unordered_map>
namespace Glom
{
diff --git a/glom/libglom/data_structure/translatable_item.h b/glom/libglom/data_structure/translatable_item.h
index 96609f4..ff12b19 100644
--- a/glom/libglom/data_structure/translatable_item.h
+++ b/glom/libglom/data_structure/translatable_item.h
@@ -22,7 +22,7 @@
#define GLOM_DATASTRUCTURE_TRANSLATABLE_ITEM_H
#include <glibmm/ustring.h>
-#include <map>
+#include <unordered_map>
#include <libglom/sharedptr.h>
namespace Glom
@@ -94,7 +94,7 @@ public:
/// Clear the original title and any translations of the title.
void clear_title_in_all_locales() noexcept;
- typedef std::map<Glib::ustring, Glib::ustring> type_map_locale_to_translations;
+ typedef std::unordered_map<Glib::ustring, Glib::ustring, std::hash<std::string>>
type_map_locale_to_translations;
bool get_has_translations() const noexcept;
diff --git a/glom/libglom/db_utils.h b/glom/libglom/db_utils.h
index 8340686..48e6dcf 100644
--- a/glom/libglom/db_utils.h
+++ b/glom/libglom/db_utils.h
@@ -219,7 +219,7 @@ bool remove_user_from_group(const Glib::ustring& user, const Glib::ustring& grou
*/
Gnome::Gda::Value get_lookup_value(const std::shared_ptr<const Document>& document, const Glib::ustring&
table_name, const std::shared_ptr<const Relationship>& relationship, const std::shared_ptr<const Field>&
source_field, const Gnome::Gda::Value & key_value);
-typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_fields;
+typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_map_fields;
//TODO: Performance: This is massively inefficient:
type_map_fields get_record_field_values(const std::shared_ptr<const Document>& document, const
Glib::ustring& table_name, const std::shared_ptr<const Field>& primary_key, const Gnome::Gda::Value&
primary_key_value);
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index 6d20d5c..41c5285 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -602,17 +602,17 @@ private:
typedef std::vector< LayoutInfo > type_layouts;
type_layouts m_layouts;
- typedef std::map< Glib::ustring, std::shared_ptr<Report> > type_reports; //map of report names to reports
+ typedef std::unordered_map< Glib::ustring, std::shared_ptr<Report> > type_reports; //map of report names
to reports
type_reports m_reports;
- typedef std::map< Glib::ustring, std::shared_ptr<PrintLayout> > type_print_layouts; //map of print
layout names to print layouts
+ typedef std::unordered_map< Glib::ustring, std::shared_ptr<PrintLayout> > type_print_layouts; //map of
print layout names to print layouts
type_print_layouts m_print_layouts;
//Example data, used when creating a database from an example.
type_example_rows m_example_rows;
//Per-session, not saved in document:
- typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_layout_primarykeys;
+ typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>>
type_map_layout_primarykeys;
type_map_layout_primarykeys m_map_current_record; //The record last viewed in each layout.
Glib::ustring m_layout_current;
FoundSet m_foundset_current;
diff --git a/glom/libglom/privs.h b/glom/libglom/privs.h
index b30e7b3..34bbd01 100644
--- a/glom/libglom/privs.h
+++ b/glom/libglom/privs.h
@@ -87,7 +87,7 @@ public:
private:
static bool on_privs_privileges_cache_timeout(const Glib::ustring& table_name);
- typedef std::map<Glib::ustring, Privileges> type_map_privileges;
+ typedef std::unordered_map<Glib::ustring, Privileges, std::hash<std::string>> type_map_privileges;
//A map of table names to cached privileges:
static type_map_privileges m_privileges_cache;
@@ -95,7 +95,7 @@ private:
// Store the cache for a few seconds in case it
// is immediately requested again, to avoid
// introspecting again, which is slow.
- typedef std::map<Glib::ustring, sigc::connection> type_map_cache_timeouts;
+ typedef std::unordered_map<Glib::ustring, sigc::connection, std::hash<std::string>>
type_map_cache_timeouts;
static type_map_cache_timeouts m_map_cache_timeouts;
};
diff --git a/glom/libglom/python_embed/py_glom_record.h b/glom/libglom/python_embed/py_glom_record.h
index 719c4da..d014c1d 100644
--- a/glom/libglom/python_embed/py_glom_record.h
+++ b/glom/libglom/python_embed/py_glom_record.h
@@ -53,7 +53,7 @@ public:
boost::python::object get_related();
//Available, for instance, in python via record["name_first"]
- typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_field_values;
+ typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_map_field_values;
//[] notation:
type_map_field_values::size_type len() const;
diff --git a/glom/libglom/python_embed/py_glom_related.h b/glom/libglom/python_embed/py_glom_related.h
index 6b80fdf..cba9c90 100644
--- a/glom/libglom/python_embed/py_glom_related.h
+++ b/glom/libglom/python_embed/py_glom_related.h
@@ -37,7 +37,7 @@ public:
PyGlomRelated();
~PyGlomRelated();
- typedef std::map<Glib::ustring, std::shared_ptr<Relationship> > type_map_relationships;
+ typedef std::unordered_map<Glib::ustring, std::shared_ptr<Relationship> , std::hash<std::string>>
type_map_relationships;
void set_relationships(const PyGlomRelated::type_map_relationships& relationships);
@@ -48,7 +48,7 @@ public:
friend class PyGlomRecord;
private:
- typedef std::map<Glib::ustring, boost::python::object /* Actually PyGlomRelatedRecord* */>
type_map_relatedrecords;
+ typedef std::unordered_map<Glib::ustring, boost::python::object /* Actually PyGlomRelatedRecord* */,
std::hash<std::string>> type_map_relatedrecords;
boost::python::object m_record; //Actually PyGlomRecord. A reference to the parent record.
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.h
b/glom/libglom/python_embed/py_glom_relatedrecord.h
index 4b2c0a7..0b7d335 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.h
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.h
@@ -46,7 +46,7 @@ public:
boost::python::object max(const std::string& field_name) const;
//Available, for instance, in python via record["name_first"]
- typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_field_values;
+ typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_map_field_values;
//[] notation:
type_map_field_values::size_type len() const;
diff --git a/glom/mode_data/box_data_calendar_related.h b/glom/mode_data/box_data_calendar_related.h
index 479d50c..3fb2081 100644
--- a/glom/mode_data/box_data_calendar_related.h
+++ b/glom/mode_data/box_data_calendar_related.h
@@ -98,7 +98,15 @@ private:
//For each date we have a list of rows (vectors):
typedef std::vector<Gnome::Gda::Value> type_vector_values;
typedef std::list<type_vector_values*> type_list_vectors;
+
+ // TODO: Use std::unordered_map, maybe like this:
+ //static constexpr auto date_hash = [](const Glib::Date& date) {
+ // std::tm ctm;
+ // return std::hash<std::tm>()(ctm);
+ //};
+ //typedef std::unordered_map<Glib::Date, type_list_vectors, decltype(date_hash)> type_map_values;
typedef std::map<Glib::Date, type_list_vectors> type_map_values;
+
type_map_values m_map_values;
mutable int m_query_column_date_field;
};
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.h
b/glom/mode_data/datawidget/combo_as_radio_buttons.h
index 1f00bfd..06594d3 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.h
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.h
@@ -92,7 +92,7 @@ private:
Glib::ustring m_old_text;
- typedef std::map<Glib::ustring, Gtk::RadioButton*> type_map_buttons;
+ typedef std::unordered_map<Glib::ustring, Gtk::RadioButton*, std::hash<std::string>> type_map_buttons;
type_map_buttons m_map_buttons;
};
diff --git a/glom/mode_data/datawidget/treemodel_db.h b/glom/mode_data/datawidget/treemodel_db.h
index c33366f..504b21c 100644
--- a/glom/mode_data/datawidget/treemodel_db.h
+++ b/glom/mode_data/datawidget/treemodel_db.h
@@ -42,7 +42,7 @@ public:
//Field Values. We store them here after reading them from the database,
//so that we can change them without changing them in the database immediately.
//This is a duplication of data but at least we are still only getting the _rows_ that will be displayed.
//TODO_Performance?
- typedef std::map<int, DbValue > type_vec_values;
+ typedef std::unordered_map<int, DbValue > type_vec_values;
type_vec_values m_db_values;
///Gets the values from the database if necessary.
@@ -205,7 +205,7 @@ private:
guint m_data_model_columns_count; //1 less than m_columns_count, which also has a model column for the
key.
//TODO: Performance:
- typedef std::map<type_datamodel_row_index, DbTreeModelRow> type_map_rows;
+ typedef std::unordered_map<type_datamodel_row_index, DbTreeModelRow> type_map_rows;
mutable type_map_rows m_map_rows; //mutable because getting fills the internal cache.
int m_count_extra_rows; //Rows that are not from the database.
int m_count_removed_rows; //A cache, instead of searching through the map.
diff --git a/glom/mode_data/db_adddel/db_adddel.h b/glom/mode_data/db_adddel/db_adddel.h
index 72cb265..002af7a 100644
--- a/glom/mode_data/db_adddel/db_adddel.h
+++ b/glom/mode_data/db_adddel/db_adddel.h
@@ -32,7 +32,7 @@
#include <giomm/simpleactiongroup.h>
#include <vector>
-#include <map>
+#include <unordered_map>
#include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
diff --git a/glom/mode_data/flowtablewithfields.h b/glom/mode_data/flowtablewithfields.h
index 1f03852..688d3da 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -44,7 +44,7 @@
#include <gtkmm/sizegroup.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/box.h>
-#include <map>
+#include <unordered_map>
#include <list>
namespace Glom
diff --git a/glom/mode_design/iso_codes.cc b/glom/mode_design/iso_codes.cc
index 10f037c..6cbbcff 100644
--- a/glom/mode_design/iso_codes.cc
+++ b/glom/mode_design/iso_codes.cc
@@ -39,7 +39,7 @@ namespace IsoCodes
static type_list_currencies list_currencies;
static type_list_locales list_locales;
-typedef std::map<Glib::ustring, Locale> type_map_locales; //ID to locale.
+typedef std::unordered_map<Glib::ustring, Locale, std::hash<std::string>> type_map_locales; //ID to locale.
static type_map_locales map_locales; //For quick lookup.
type_list_currencies get_list_of_currency_symbols()
@@ -143,7 +143,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
}
//Get the (translated) language names:
- typedef std::map<Glib::ustring, Glib::ustring> type_map_language; //ID to language name.
+ typedef std::unordered_map<Glib::ustring, Glib::ustring, std::hash<std::string>> type_map_language; //ID
to language name.
type_map_language map_languages;
const std::string filename_languages = ISO_CODES_PREFIX "/share/xml/iso-codes/iso_639.xml";
@@ -193,7 +193,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
}
//Get the (translated) country names:
- typedef std::map<Glib::ustring, Glib::ustring> type_map_country; //ID to country name.
+ typedef std::unordered_map<Glib::ustring, Glib::ustring, std::hash<std::string>> type_map_country; //ID
to country name.
type_map_country map_country;
const Glib::ustring filename_countries = ISO_CODES_PREFIX "/share/xml/iso-codes/iso_3166.xml";
diff --git a/glom/mode_design/relationships_overview/canvas_group_dbtable.h
b/glom/mode_design/relationships_overview/canvas_group_dbtable.h
index 8e44dde..15d47dd 100644
--- a/glom/mode_design/relationships_overview/canvas_group_dbtable.h
+++ b/glom/mode_design/relationships_overview/canvas_group_dbtable.h
@@ -48,7 +48,7 @@ private:
double m_table_height;
static double m_table_width;
- typedef std::map <Glib::ustring, double> type_map_fields_y;
+ typedef std::unordered_map <Glib::ustring, double> type_map_fields_y;
type_map_fields_y m_map_fields_y;
};
diff --git a/glom/mode_design/relationships_overview/window_relationships_overview.h
b/glom/mode_design/relationships_overview/window_relationships_overview.h
index 670d9c5..96386a5 100644
--- a/glom/mode_design/relationships_overview/window_relationships_overview.h
+++ b/glom/mode_design/relationships_overview/window_relationships_overview.h
@@ -33,7 +33,7 @@
#include <gtkmm/builder.h>
#include <glibmm/weakref.h>
#include <goocanvasmm/canvas.h>
-#include <map>
+#include <unordered_map>
#include <vector>
//#include "relationships_canvas.h"
@@ -85,7 +85,7 @@ private:
CanvasEditable m_canvas;
Gtk::ScrolledWindow* m_scrolledwindow_canvas;
- //typedef std::map<Glib::RefPtr<Goocanvas::Item>, TableView*> type_map_item_tables;
+ //typedef std::unordered_map<Glib::RefPtr<Goocanvas::Item>, TableView*> type_map_item_tables;
//type_map_item_tables m_tables;
static int m_last_size_x, m_last_size_y;
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index b9c938d..8ff0f56 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -744,7 +744,7 @@ void Canvas_PrintLayout::fill_with_data_system_preferences(const Glib::RefPtr<Ca
void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& canvas_group, const FoundSet&
found_set, bool avoid_page_margins)
{
//A map of the text representation (e.g. field_name or relationship::field_name) to the index:
- typedef std::map<Glib::ustring, guint> type_map_layout_fields_index;
+ typedef std::unordered_map<Glib::ustring, guint, std::hash<std::string>> type_map_layout_fields_index;
type_map_layout_fields_index map_fields_index;
//Get list of fields to get from the database.
diff --git a/glom/python_embed/glom_python.h b/glom/python_embed/glom_python.h
index 5a089b0..0b680cd 100644
--- a/glom/python_embed/glom_python.h
+++ b/glom/python_embed/glom_python.h
@@ -44,7 +44,7 @@ bool gir_python_module_is_available();
*/
bool gda_python_module_is_available();
-typedef std::map<Glib::ustring, Gnome::Gda::Value> type_map_fields;
+typedef std::unordered_map<Glib::ustring, Gnome::Gda::Value, std::hash<std::string>> type_map_fields;
/** Run a script, ignoring the python return value.
* The record object will be writable and the function will receive a ui
diff --git a/glom/utility_widgets/adddel/adddel.h b/glom/utility_widgets/adddel/adddel.h
index 76511c0..27c6299 100644
--- a/glom/utility_widgets/adddel/adddel.h
+++ b/glom/utility_widgets/adddel/adddel.h
@@ -31,7 +31,7 @@
#include <giomm/simpleactiongroup.h>
#include <vector>
-#include <map>
+#include <unordered_map>
namespace Glom
{
diff --git a/glom/utility_widgets/canvas/canvas_editable.h b/glom/utility_widgets/canvas/canvas_editable.h
index 490bdad..5f934c5 100644
--- a/glom/utility_widgets/canvas/canvas_editable.h
+++ b/glom/utility_widgets/canvas/canvas_editable.h
@@ -24,7 +24,7 @@
#include <goocanvasmm/canvas.h>
#include <glom/utility_widgets/canvas/canvas_group_grid.h>
#include <glom/utility_widgets/canvas/canvas_item_movable.h>
-#include <map>
+#include <unordered_map>
#include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
namespace Glom
diff --git a/glom/variablesmap.h b/glom/variablesmap.h
index e82e792..bbf535a 100644
--- a/glom/variablesmap.h
+++ b/glom/variablesmap.h
@@ -22,7 +22,7 @@
#include <gtkmm/builder.h>
#include <glibmm/date.h>
-#include <map>
+#include <unordered_map>
namespace Glom
{
@@ -76,7 +76,7 @@ private:
void transfer_one_widget(Gtk::Widget* pWidget, bool to_variable);
- typedef std::map<Gtk::Widget*, void*> type_mapWidgetsToVariables;
+ typedef std::unordered_map<Gtk::Widget*, void*> type_mapWidgetsToVariables;
type_mapWidgetsToVariables m_mapWidgetsToVariables;
Glib::RefPtr<Gtk::Builder> m_builder;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]