mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-02 03:40:12 +00:00
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:
parent
cb6d594a89
commit
b805f55ba8
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user