1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

remove std::visit because apple is functionally retarded and does not support it despite claiming to support c++14

This commit is contained in:
Jeff Becker 2021-03-20 10:05:36 -04:00
parent 6c1d18412c
commit f10269b03e
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
3 changed files with 8 additions and 10 deletions

View file

@ -501,7 +501,10 @@ namespace llarp
LookupNameAsync(lnsName, [msg, lnsName, reply](auto maybe) mutable {
if (maybe.has_value())
{
std::visit([&](auto&& value) { msg.AddMXReply(value.ToString(), 1); }, *maybe);
if (auto* addr = std::get_if<service::Address>(&*maybe))
{
msg.AddMXReply(addr->ToString(), 1);
}
}
else
{

View file

@ -294,15 +294,6 @@ namespace llarp::rpc
reply(CreateJSONError("we could not find an exit with that name"));
return;
}
std::visit(
[&](auto&& value) {
if (value.IsZero())
{
reply(CreateJSONError("lokinet exit does not exist"));
return;
}
},
*maybe);
if (auto ptr = std::get_if<service::Address>(&*maybe))
{
mapExit(*ptr);

View file

@ -827,6 +827,10 @@ namespace llarp
}
auto maybeInvalidateCache = [handler, &cache, name](auto result) {
if (result and result->IsZero())
{
result = std::nullopt;
}
if (result)
{
cache.Put(name, *result);