From 352d774760fad55ef7b952481a5bff2dda782c05 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 3 May 2017 20:48:15 +0200 Subject: [PATCH] Prefer empty check over length one --- src/anbox/android/intent.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/anbox/android/intent.cpp b/src/anbox/android/intent.cpp index 8344dc0..2fcd8f0 100644 --- a/src/anbox/android/intent.cpp +++ b/src/anbox/android/intent.cpp @@ -23,19 +23,19 @@ namespace anbox { namespace android { std::ostream &operator<<(std::ostream &out, const Intent &intent) { out << "["; - if (intent.action.length() > 0) + if (!intent.action.empty()) out << " " << "action=" << intent.action << " "; - if (intent.uri.length() > 0) + if (!intent.uri.empty()) out << " " << "uri=" << intent.uri << " "; - if (intent.type.length() > 0) + if (!intent.type.empty()) out << " " << "type=" << intent.type << " "; if (intent.flags > 0) out << " " << "flags=" << intent.flags << " "; - if (intent.package.length() > 0) + if (!intent.package.empty()) out << " " << "package=" << intent.package << " "; - if (intent.component.length() > 0) + if (!intent.component.empty()) out << "component=" << intent.component << " "; - if (intent.categories.size() > 0) { + if (!intent.categories.size() > 0) { out << "categories=[ "; for (const auto &category : intent.categories) out << category << " "; out << "] ";