summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-01-08 12:36:53 +0800
committerPeng Wu <alexepico@gmail.com>2016-01-08 12:36:53 +0800
commit96ca8abf09bd53ed62ed5be347d5243e9ce9f154 (patch)
tree506be27ac752eeaee2147a7510e2cd8b7562e31c /src
parentc253c4fcbf2a9b49224a825f5e5dcffcb412d0a0 (diff)
refactor code
Diffstat (limited to 'src')
-rw-r--r--src/storage/pinyin_phrase2.h17
-rw-r--r--src/storage/pinyin_phrase3.h17
2 files changed, 17 insertions, 17 deletions
diff --git a/src/storage/pinyin_phrase2.h b/src/storage/pinyin_phrase2.h
index fab19c7..655678b 100644
--- a/src/storage/pinyin_phrase2.h
+++ b/src/storage/pinyin_phrase2.h
@@ -312,23 +312,6 @@ public:
};
-/* for find the element in the phrase array */
-template<size_t phrase_length>
-inline int phrase_exact_compare2(const PinyinIndexItem2<phrase_length> &lhs,
- const PinyinIndexItem2<phrase_length> &rhs)
-{
- ChewingKey * keys_lhs = (ChewingKey *) lhs.m_keys;
- ChewingKey * keys_rhs = (ChewingKey *) rhs.m_keys;
- return pinyin_exact_compare2(keys_lhs, keys_rhs, phrase_length);
-}
-
-template<size_t phrase_length>
-inline bool phrase_exact_less_than2(const PinyinIndexItem2<phrase_length> &lhs,
- const PinyinIndexItem2<phrase_length> &rhs)
-{
- return 0 > phrase_exact_compare2<phrase_length>(lhs, rhs);
-}
-
};
#endif
diff --git a/src/storage/pinyin_phrase3.h b/src/storage/pinyin_phrase3.h
index b99bc15..6ce1698 100644
--- a/src/storage/pinyin_phrase3.h
+++ b/src/storage/pinyin_phrase3.h
@@ -60,6 +60,23 @@ inline int pinyin_exact_compare2(const ChewingKey * key_lhs,
return 0;
}
+/* for find the element in the phrase array */
+template<size_t phrase_length>
+inline int phrase_exact_compare2(const PinyinIndexItem2<phrase_length> &lhs,
+ const PinyinIndexItem2<phrase_length> &rhs)
+{
+ ChewingKey * keys_lhs = (ChewingKey *) lhs.m_keys;
+ ChewingKey * keys_rhs = (ChewingKey *) rhs.m_keys;
+ return pinyin_exact_compare2(keys_lhs, keys_rhs, phrase_length);
+}
+
+template<size_t phrase_length>
+inline bool phrase_exact_less_than2(const PinyinIndexItem2<phrase_length> &lhs,
+ const PinyinIndexItem2<phrase_length> &rhs)
+{
+ return 0 > phrase_exact_compare2<phrase_length>(lhs, rhs);
+}
+
};