QTimeZonePrivate: make windowsId return a QByteArrayView
In debug this cuts off about 4 seconds off of the qtimezone test on my machine. In release it's about 300-400 milliseconds. Change-Id: I92ec18794247e3846704a7c8e87a8c34fdae5e3c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
dc5e8aa81c
commit
6765dbf77a
@ -79,7 +79,7 @@ static const QUtcData *utcData(quint16 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return the Windows ID literal for a given QWindowsData
|
// Return the Windows ID literal for a given QWindowsData
|
||||||
static QByteArray windowsId(const QWindowsData *windowsData)
|
static QByteArrayView windowsId(const QWindowsData *windowsData)
|
||||||
{
|
{
|
||||||
return (windowsIdData + windowsData->windowsIdIndex);
|
return (windowsIdData + windowsData->windowsIdIndex);
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ static QByteArray toWindowsIdLiteral(quint16 windowsIdKey)
|
|||||||
for (quint16 i = 0; i < windowsDataTableSize; ++i) {
|
for (quint16 i = 0; i < windowsDataTableSize; ++i) {
|
||||||
const QWindowsData *data = windowsData(i);
|
const QWindowsData *data = windowsData(i);
|
||||||
if (data->windowsIdKey == windowsIdKey)
|
if (data->windowsIdKey == windowsIdKey)
|
||||||
return windowsId(data);
|
return windowsId(data).toByteArray();
|
||||||
}
|
}
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user