2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 13:47:46 +00:00

string_view refactor

This commit is contained in:
Jack Andersen
2017-11-12 20:14:52 -10:00
parent 4ba4022277
commit 1b7874a7b2
31 changed files with 216 additions and 196 deletions

View File

@@ -539,13 +539,13 @@ bool Table::CellView::reset(size_t c)
{
m_c = c;
m_r = -1;
const std::string* headerText = m_t.m_data->header(c);
if (headerText)
auto headerText = m_t.m_data->header(c);
if (!headerText.empty())
{
uint64_t hash = XXH64(headerText->data(), headerText->size(), 0);
uint64_t hash = XXH64(headerText.data(), headerText.size(), 0);
if (hash != m_textHash)
{
m_text->typesetGlyphs(*headerText, rootView().themeData().uiText());
m_text->typesetGlyphs(headerText, rootView().themeData().uiText());
m_textHash = hash;
}
return true;
@@ -562,13 +562,13 @@ bool Table::CellView::reset(size_t c, size_t r)
{
m_c = c;
m_r = r;
const std::string* cellText = m_t.m_data->cell(c, r);
if (cellText)
auto cellText = m_t.m_data->cell(c, r);
if (!cellText.empty())
{
uint64_t hash = XXH64(cellText->data(), cellText->size(), 0);
uint64_t hash = XXH64(cellText.data(), cellText.size(), 0);
if (hash != m_textHash)
{
m_text->typesetGlyphs(*cellText, rootView().themeData().uiText());
m_text->typesetGlyphs(cellText, rootView().themeData().uiText());
m_textHash = hash;
}
return true;