summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-03-17 12:28:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2022-03-22 17:43:13 +0100
commit90406af31a9e4352ab7b5d23cde2f4b4c9e6d4c8 (patch)
tree0a5050479e203450d483bb6411fa21c099d3cc14 /src
parent02d130db7ebaa09f671c48ac83dfd5c3a250be16 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qtaptestlogger.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp
index 62fde40d64..9926836c34 100644
--- a/src/testlib/qtaptestlogger.cpp
+++ b/src/testlib/qtaptestlogger.cpp
@@ -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();