Use a cheaper is-empty test for a C-string

We only need to look at the first byte to determine whether the length
is > 0; no need to count how many more bytes after it aren't '\0'.

Change-Id: Id2db2a9a993086c0aee02c99396fcb346b1a348e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Edward Welbourne 2022-03-17 12:28:00 +01:00
parent 02d130db7e
commit 90406af31a
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
QTestCharBuffer directive;
if (incident) {
QTest::qt_asprintf(&directive, " # %s%s%s", incident,
qstrlen(description) ? " " : "", description);
description && description[0] ? " " : "", description);
}
int testNumber = QTestLog::totalCount();