editeng/source/items/paraitem.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7d3817289586d8765e066fee6551b66ddb5d0ab3
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Aug 22 13:35:33 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Aug 23 08:04:48 2024 +0200

    tdf#158556 improve SvxTabStopItem::hashCode
    
    to provide more discrimination, which means we spend less time in
    operator== when searching the pool
    
    Change-Id: I9beb8218fdd4b4fb3d60ecf6db461ae818d2a9ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172291
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index 4019a6ce2c6b..27331148d486 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -1065,9 +1065,12 @@ bool SvxTabStopItem::operator==( const SfxPoolItem& 
rAttr ) const
 size_t SvxTabStopItem::hashCode() const
 {
     std::size_t seed(0);
-    o3tl::hash_combine(seed, Which());
     o3tl::hash_combine(seed, mnDefaultDistance);
-    o3tl::hash_combine(seed, maTabStops.size());
+    for (const SvxTabStop & rStop : maTabStops)
+    {
+        o3tl::hash_combine(seed, rStop.GetTabPos());
+        o3tl::hash_combine(seed, rStop. GetAdjustment());
+    }
     return seed;
 }
 

Reply via email to