From 3bbd4a096a1821e151612def4079befbb62f4618 Mon Sep 17 00:00:00 2001 From: xy Date: Sat, 11 Aug 2012 16:46:13 +0800 Subject: [PATCH] Inline. --- src/subtitles/cache_manager.h | 28 +++++++++++++++++----------- src/subtitles/flyweight_base_types.h | 6 +++--- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/subtitles/cache_manager.h b/src/subtitles/cache_manager.h index 6936d70..26b73cb 100644 --- a/src/subtitles/cache_manager.h +++ b/src/subtitles/cache_manager.h @@ -13,10 +13,16 @@ template class XyCacheKeyTraits:public CElementTraits { public: - static ULONG Hash(const CahcheKey& key) + static inline ULONG Hash(const CahcheKey& key) { return key.GetHashValue(); } + static inline bool CompareElements( + const CahcheKey& element1, + const CahcheKey& element2) + { + return ( (element1==element2)!=0 ); + } }; class TextInfoCacheKey @@ -30,7 +36,7 @@ public: bool operator==(const TextInfoCacheKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -63,7 +69,7 @@ public: static bool CompareSTSStyle(const STSStyle& lhs, const STSStyle& rhs); ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -87,7 +93,7 @@ public: bool operator==(const ScanLineData2CacheKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -106,7 +112,7 @@ public: bool operator==(const OverlayNoBlurKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -124,7 +130,7 @@ public: bool operator==(const OverlayKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -139,7 +145,7 @@ public: bool operator==(const ScanLineDataCacheKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -158,7 +164,7 @@ public: bool operator==(const OverlayNoOffsetKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -176,7 +182,7 @@ public: bool operator==(const ClipperAlphaMaskCacheKey& key)const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -194,7 +200,7 @@ public: bool operator==(const DrawItemHashKey& hash_key) const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } @@ -218,7 +224,7 @@ public: bool operator==(const GroupedDrawItemsHashKey& key) const; ULONG UpdateHashValue(); - ULONG GetHashValue()const + inline ULONG GetHashValue()const { return m_hash_value; } diff --git a/src/subtitles/flyweight_base_types.h b/src/subtitles/flyweight_base_types.h index ebab936..82a94e7 100644 --- a/src/subtitles/flyweight_base_types.h +++ b/src/subtitles/flyweight_base_types.h @@ -34,17 +34,17 @@ public: class SharedVElementTraits:public CElementTraits { public: - static ULONG Hash(const SharedConstV& v) + static inline ULONG Hash(const SharedConstV& v) { return VTraits::Hash(*v); } - static bool CompareElements( + static inline bool CompareElements( const SharedConstV& element1, const SharedConstV& element2) { return VTraits::CompareElements(*element1, *element2); } - static int CompareElementsOrdered( + static inline int CompareElementsOrdered( const SharedConstV& element1, const SharedConstV& element2) { -- 2.11.4.GIT