Fix the rendering of SEENBY/PATH lines in packets, which should have each new line prefixed with host
This commit is contained in:
@@ -162,29 +162,4 @@ if (! function_exists('wtime')) {
|
||||
|
||||
return Carbon::create($year,$month,$day,$hr,$min,$sec+$milli/10);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('optimize_path')) {
|
||||
/**
|
||||
* This will optimize an array of paths to show the smallest number of characters
|
||||
*/
|
||||
function optimize_path(Collection $path): Collection
|
||||
{
|
||||
$cur = NULL;
|
||||
$result = collect();
|
||||
|
||||
foreach ($path as $address) {
|
||||
[$host,$node] = explode('/',$address);
|
||||
|
||||
if ($host !== $cur) {
|
||||
$cur = $host;
|
||||
$result->push($address);
|
||||
|
||||
} else {
|
||||
$result->push($node);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user