Replace std::map with std::array for graphics event breakpoints, and allow the compiler to inline. Saves 1%+ in vertex heavy situations.

This commit is contained in:
Henrik Rydgard 2016-04-24 14:19:49 +02:00
parent 0964a3ff53
commit 01a1555b5d
3 changed files with 16 additions and 9 deletions

View file

@ -75,7 +75,7 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const
case Role_IsEnabled:
{
auto context = context_weak.lock();
return context && context->breakpoints[event].enabled;
return context && context->breakpoints[(int)event].enabled;
}
default:
@ -110,7 +110,7 @@ bool BreakPointModel::setData(const QModelIndex& index, const QVariant& value, i
if (!context)
return false;
context->breakpoints[event].enabled = value == Qt::Checked;
context->breakpoints[(int)event].enabled = value == Qt::Checked;
QModelIndex changed_index = createIndex(index.row(), 0);
emit dataChanged(changed_index, changed_index);
return true;