Do not use flat_set anymore gives compilation issues.

Not worth the time solving the issue without having prove of a clear benefit of
using flat_set over unordered_set.
This commit is contained in:
eelke 2018-12-23 08:39:38 +01:00
parent 1854a4bdaa
commit 6a2c8ec5e0
5 changed files with 13 additions and 11 deletions

View file

@ -9,7 +9,7 @@
#include "CustomDataRole.h" #include "CustomDataRole.h"
#include "PgLabItemDelegate.h" #include "PgLabItemDelegate.h"
#include <QStringBuilder> #include <QStringBuilder>
#include <boost/container/flat_set.hpp> #include <unordered_set>
#include "SqlFormattingUtils.h" #include "SqlFormattingUtils.h"
ColumnPage::ColumnPage(QWidget *parent) ColumnPage::ColumnPage(QWidget *parent)
@ -57,7 +57,7 @@ void ColumnPage::setData(std::shared_ptr<const PgDatabaseCatalog> cat, const std
void ColumnPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) void ColumnPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
{ {
auto&& indexes = m_tableView->selectionModel()->selectedIndexes(); auto&& indexes = m_tableView->selectionModel()->selectedIndexes();
boost::container::flat_set<int> rijen; std::unordered_set<int> rijen;
for (const auto &e : indexes) for (const auto &e : indexes)
rijen.insert(m_sortFilterProxy->mapToSource(e).row()); rijen.insert(m_sortFilterProxy->mapToSource(e).row());

View file

@ -20,7 +20,7 @@
#include "UserConfiguration.h" #include "UserConfiguration.h"
#include "SqlCodePreview.h" #include "SqlCodePreview.h"
#include <QStringBuilder> #include <QStringBuilder>
#include <boost/container/flat_set.hpp> #include <unordered_set>
TablesPage::TablesPage(MainWindow *parent) TablesPage::TablesPage(MainWindow *parent)
: QWidget(parent) : QWidget(parent)
@ -186,7 +186,7 @@ void TablesPage::selectedTableChanged(const std::optional<PgClass> &table)
void TablesPage::constraintsTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) void TablesPage::constraintsTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
{ {
const auto indexes = ui->constraintsTable->selectionModel()->selectedIndexes(); const auto indexes = ui->constraintsTable->selectionModel()->selectedIndexes();
boost::container::flat_set<int> rijen; std::unordered_set<int> rijen;
for (const auto &e : indexes) for (const auto &e : indexes)
rijen.insert(e.row()); rijen.insert(e.row());
@ -208,7 +208,7 @@ void TablesPage::constraintsTable_modelReset()
void TablesPage::indexesTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) void TablesPage::indexesTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
{ {
const auto indexes = ui->indexesTable->selectionModel()->selectedIndexes(); const auto indexes = ui->indexesTable->selectionModel()->selectedIndexes();
boost::container::flat_set<int> rijen; std::unordered_set<int> rijen;
for (const auto &e : indexes) for (const auto &e : indexes)
rijen.insert(e.row()); rijen.insert(e.row());

View file

@ -9,7 +9,7 @@
#include "CustomDataRole.h" #include "CustomDataRole.h"
#include "PgLabItemDelegate.h" #include "PgLabItemDelegate.h"
#include <QStringBuilder> #include <QStringBuilder>
#include <boost/container/flat_set.hpp> #include <unordered_set>
TriggerPage::TriggerPage(QWidget *parent) TriggerPage::TriggerPage(QWidget *parent)
: QSplitter(Qt::Vertical, parent) : QSplitter(Qt::Vertical, parent)
@ -55,7 +55,7 @@ void TriggerPage::setFilter(const std::optional<PgClass> &cls)
void TriggerPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) void TriggerPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
{ {
auto&& indexes = m_tableView->selectionModel()->selectedIndexes(); auto&& indexes = m_tableView->selectionModel()->selectedIndexes();
boost::container::flat_set<int> rijen; std::unordered_set<int> rijen;
for (const auto &e : indexes) for (const auto &e : indexes)
rijen.insert(m_sortFilterProxy->mapToSource(e).row()); rijen.insert(m_sortFilterProxy->mapToSource(e).row());

View file

@ -1,12 +1,13 @@
#include "PgKeywordList.h" #include "PgKeywordList.h"
#include <boost/container/flat_set.hpp> #include <unordered_set>
namespace { namespace {
using KeywordHT = boost::container::flat_set<Keyword>; using KeywordHT = std::unordered_set<Keyword>;
#define PG_KEYWORD(a,b,c) {a,c}, #define PG_KEYWORD(a,b,c) Keyword{a,c},
const KeywordHT _ScanKeywords = { const KeywordHT _ScanKeywords {
//const Keyword _ScanKeywords[] = {
#include <server/parser/kwlist.h> #include <server/parser/kwlist.h>
}; };

View file

@ -27,6 +27,7 @@ public:
//bool operator<(const QString &s) const { return m_keyword < s; } //bool operator<(const QString &s) const { return m_keyword < s; }
bool operator<(const Keyword &kw) const { return m_keyword < kw.m_keyword; } bool operator<(const Keyword &kw) const { return m_keyword < kw.m_keyword; }
bool operator==(const Keyword &kw) const { return m_keyword == kw.m_keyword; }
private: private:
QString m_keyword; QString m_keyword;
int16_t m_category; int16_t m_category;