diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-22 13:35:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-08-23 08:04:48 +0200 |
commit | 7d3817289586d8765e066fee6551b66ddb5d0ab3 (patch) | |
tree | 9149bd9ce83814b1390c7dd9f75f1d1b518bfba6 /editeng | |
parent | 2318b823732df3820557943e56dd5243381dc558 (diff) |
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.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/paraitem.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |