mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-27 07:18:33 +02:00
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:
@@ -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