summaryrefslogtreecommitdiff
path: root/cppu/source/uno
diff options
context:
space:
mode:
authorDaniel Sikeler <d.sikeler94@gmail.com>2014-09-12 06:17:03 +0000
committerStephan Bergmann <sbergman@redhat.com>2014-09-18 13:12:48 +0200
commit32d6415617b5815bb5d18719f6d2df74becc0997 (patch)
tree55c7b6d7c068bb6eee60aa0a7add60cc6595513b /cppu/source/uno
parentd311d85a4d501a0bfef20e610169f20de896a167 (diff)
fdo#83512 Make use of OUStringHash and OStringHash
Change-Id: I33cafe68c798e3d54943ea1790fa4e73f85e525d Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cppu/source/uno')
-rw-r--r--cppu/source/uno/lbenv.cxx14
-rw-r--r--cppu/source/uno/lbmap.cxx9
2 files changed, 5 insertions, 18 deletions
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 96069a09561c..0d2bc0a80cd4 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -47,6 +47,7 @@
using ::rtl::OUString;
+using ::rtl::OUStringHash;
namespace
{
@@ -102,17 +103,9 @@ struct FctPtrHash :
};
-struct FctOUStringHash :
- public ::std::unary_function< const OUString &, ::std::size_t >
-{
- ::std::size_t operator () ( const OUString & rKey ) const
- { return rKey.hashCode(); }
-};
-
// mapping from environment name to environment
typedef ::boost::unordered_map<
- OUString, uno_Environment *, FctOUStringHash,
- ::std::equal_to< OUString > > OUString2EnvironmentMap;
+ OUString, uno_Environment *, OUStringHash > OUString2EnvironmentMap;
// mapping from ptr to object entry
typedef ::boost::unordered_map<
@@ -120,8 +113,7 @@ typedef ::boost::unordered_map<
::std::equal_to< void * > > Ptr2ObjectMap;
// mapping from oid to object entry
typedef ::boost::unordered_map<
- OUString, ObjectEntry *, FctOUStringHash,
- ::std::equal_to< OUString > > OId2ObjectMap;
+ OUString, ObjectEntry *, OUStringHash > OId2ObjectMap;
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 7c0d76552efc..48185d231b2e 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -50,6 +50,7 @@ using namespace com::sun::star::uno;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringToOString;
+using ::rtl::OUStringHash;
using ::rtl::OString;
namespace cppu
@@ -120,12 +121,6 @@ struct MappingEntry
{}
};
-struct FctOUStringHash : public std::unary_function< const OUString &, size_t >
-{
- size_t operator()( const OUString & rKey ) const
- { return (size_t)rKey.hashCode(); }
-};
-
struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t >
{
size_t operator()( uno_Mapping * pKey ) const
@@ -133,7 +128,7 @@ struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t >
};
typedef boost::unordered_map<
- OUString, MappingEntry *, FctOUStringHash, equal_to< OUString > > t_OUString2Entry;
+ OUString, MappingEntry *, OUStringHash > t_OUString2Entry;
typedef boost::unordered_map<
uno_Mapping *, MappingEntry *, FctPtrHash, equal_to< uno_Mapping * > > t_Mapping2Entry;