mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-24 19:02:16 +02:00
simplify code
This commit is contained in:
parent
f05548f3a3
commit
66f36195d8
@ -49,16 +49,16 @@ void McResolver::pingWithDomainA(QString domain, int port) {
|
|||||||
if (hostInfo.error() != QHostInfo::NoError) {
|
if (hostInfo.error() != QHostInfo::NoError) {
|
||||||
emitFail("A record lookup failed");
|
emitFail("A record lookup failed");
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
auto records = hostInfo.addresses();
|
|
||||||
if (records.isEmpty()) {
|
|
||||||
emitFail("No A entries found for domain");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& firstRecord = records.at(0);
|
|
||||||
emitSucceed(firstRecord.toString(), port);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto records = hostInfo.addresses();
|
||||||
|
if (records.isEmpty()) {
|
||||||
|
emitFail("No A entries found for domain");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& firstRecord = records.at(0);
|
||||||
|
emitSucceed(firstRecord.toString(), port);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user