1 |
From 144e73f50c49333f61c6f27b882be9dbc232ceb4 Mon Sep 17 00:00:00 2001 |
2 |
From: Noel Grandin <noel@peralex.com> |
3 |
Date: Tue, 22 Dec 2015 09:05:32 +0200 |
4 |
Subject: [PATCH] fix Link::operator< |
5 |
|
6 |
so that it is consistent with operator== |
7 |
|
8 |
Change-Id: Ie4c68a1f02d8c298fe99e42c5854f89db79bf3bc |
9 |
--- |
10 |
include/tools/link.hxx | 10 ++++++++-- |
11 |
1 file changed, 8 insertions(+), 2 deletions(-) |
12 |
|
13 |
diff --git a/include/tools/link.hxx b/include/tools/link.hxx |
14 |
index cbac102..584f963 100644 |
15 |
--- a/include/tools/link.hxx |
16 |
+++ b/include/tools/link.hxx |
17 |
@@ -88,8 +88,14 @@ public: |
18 |
bool operator !() const { return !IsSet(); } |
19 |
|
20 |
bool operator <(Link const & other) const { |
21 |
- return reinterpret_cast<sal_uIntPtr>(function_) |
22 |
- < reinterpret_cast<sal_uIntPtr>(other.function_); |
23 |
+ sal_uIntPtr ptr1 = reinterpret_cast<sal_uIntPtr>(function_); |
24 |
+ sal_uIntPtr ptr2 = reinterpret_cast<sal_uIntPtr>(other.function_); |
25 |
+ if (ptr1 < ptr2) |
26 |
+ return true; |
27 |
+ else if (ptr1 > ptr2) |
28 |
+ return false; |
29 |
+ else |
30 |
+ return instance_ < other.instance_; |
31 |
}; |
32 |
|
33 |
bool operator ==(Link const & other) const |
34 |
-- |
35 |
2.7.4 |
36 |
|