mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
AK: Simplify NetworkOrdered somewhat.
This commit is contained in:
@@ -21,27 +21,12 @@ template<typename T>
|
|||||||
class [[gnu::packed]] NetworkOrdered
|
class [[gnu::packed]] NetworkOrdered
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetworkOrdered()
|
NetworkOrdered() {}
|
||||||
: m_network_value(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NetworkOrdered(const T& host_value)
|
NetworkOrdered(const T& host_value)
|
||||||
: m_network_value(convert_between_host_and_network(host_value))
|
: m_network_value(convert_between_host_and_network(host_value))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkOrdered(const NetworkOrdered& other)
|
|
||||||
: m_network_value(other.m_network_value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NetworkOrdered& operator=(const NetworkOrdered& other)
|
|
||||||
{
|
|
||||||
m_network_value = other.m_network_value;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator T() const { return convert_between_host_and_network(m_network_value); }
|
operator T() const { return convert_between_host_and_network(m_network_value); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user