TextEditor: Improve speed of hash function for font settings

The size of the array is fixed so we can simply use the memory patter as
a hash value.

Change-Id: If86a58b111a07b2bd9cecc12a03d74b93a914159
Task-number: QTCREATORBUG-16419
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-06-09 14:49:19 +02:00
committed by David Schulz
parent 57042da683
commit a823caa396
4 changed files with 10 additions and 7 deletions

View File

@@ -108,6 +108,11 @@ public:
return m_size == 0;
}
void fillWithZero()
{
std::array<T, MaxSize>::fill(T(0));
}
private:
std::uint8_t m_size = 0;
};