diff options
author | Giuseppe D'Angelo <dangelog@gmail.com> | 2012-04-04 20:37:04 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-08 18:25:10 +0200 |
commit | ea17c21fd8b93a94027fad7d3827904ae96e2a3b (patch) | |
tree | 695df83108ba235481dd6c3df494595e9741b5b2 /src/network/kernel/qhostaddress.h | |
parent | 9166163f103b8ac35544270c8cf397de3416b8f0 (diff) |
QHostAddress: improve qHash implementation
Avoid the conversion to a temporary QString -- just hash the address
as a byte array.
Change-Id: Ic35cdbbc3ee66c32a28d911bd27de0092395979f
Done-with: Shane Kearns
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network/kernel/qhostaddress.h')
-rw-r--r-- | src/network/kernel/qhostaddress.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index b298e3f479..ce4470d32e 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -123,6 +123,7 @@ public: static QPair<QHostAddress, int> parseSubnet(const QString &subnet); + friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0); protected: QScopedPointer<QHostAddressPrivate> d; }; @@ -134,9 +135,6 @@ inline bool operator ==(QHostAddress::SpecialAddress address1, const QHostAddres Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QHostAddress &); #endif - -Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0); - #ifndef QT_NO_DATASTREAM Q_NETWORK_EXPORT QDataStream &operator<<(QDataStream &, const QHostAddress &); Q_NETWORK_EXPORT QDataStream &operator>>(QDataStream &, QHostAddress &); |