Coalesce from_string/from_string_view

The version taking a string_view will already be perfectly callable with
a string, so just combine them into one.
This commit is contained in:
Jason Rhinelander 2023-10-18 12:44:37 -03:00 committed by dr7ana
parent cb6d594a89
commit b805f55ba8
2 changed files with 4 additions and 10 deletions

View File

@ -1210,8 +1210,8 @@ namespace llarp
// extract pathIDs and check if zero or used
auto& hop_info = hop->info;
hop_info.txID.from_string_view(tx_id);
hop_info.rxID.from_string_view(rx_id);
hop_info.txID.from_string(tx_id);
hop_info.rxID.from_string(rx_id);
if (hop_info.txID.IsZero() || hop_info.rxID.IsZero())
{
@ -1220,7 +1220,7 @@ namespace llarp
return;
}
hop_info.upstream.from_string_view(upstream);
hop_info.upstream.from_string(upstream);
// TODO: need downstream (above), and also the whole transit hop container is garbage.
// namely the PathID uniqueness checking uses the PathIDs and upstream/downstream

View File

@ -242,7 +242,7 @@ namespace llarp
}
bool
from_string_view(std::string_view b)
from_string(std::string_view b)
{
if (b.size() != sz)
{
@ -254,12 +254,6 @@ namespace llarp
return true;
}
bool
from_string(std::string b)
{
return from_string_view(b);
}
bool
bt_encode(llarp_buffer_t* buf) const
{