util: dedup code in callers of serviceFlagToStr()
Introduce `serviceFlagsToStr()` which hides the internals of the bitmask and simplifies callers of `serviceFlagToStr()`.
This commit is contained in:
4 files changed
+26
-16
No files matched your search
+2
-6
@@ -755,12 +755,8 @@ QString formatServicesStr(quint64 mask)
|
||||
{
|
||||
QStringList strList;
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
uint64_t check = 1ull << i;
|
||||
if (mask & check)
|
||||
{
|
||||
strList.append(QString::fromStdString(serviceFlagToStr(i)));
|
||||
}
|
||||
for (const auto& flag : serviceFlagsToStr(mask)) {
|
||||
strList.append(QString::fromStdString(flag));
|
||||
}
|
||||
|
||||
if (strList.size())
|
||||
|
||||
Reference in new issue
Block a user