in Core/src/Impl/Storages/SymbolStoragePath.cs [93:103]
public static SymbolStoragePathRef GetDirectoryName(SymbolStoragePathRef storagePath)
{
var pathStr = storagePath.Path;
int end = pathStr.Length - 1;
while (end >= 0 && pathStr[end] != DirectorySeparator)
end--;
while (end >= 0 && pathStr[end] == DirectorySeparator)
end--;
return end < 0 ? SymbolStoragePathRef.Empty : SymbolStoragePathRef.CreateUnsafe(storagePath.Path.Slice(0, end + 1));
}