diff options
Diffstat (limited to 'src/storage/pinyin_base.cpp')
-rw-r--r-- | src/storage/pinyin_base.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/storage/pinyin_base.cpp b/src/storage/pinyin_base.cpp index 90a0baa..66587f0 100644 --- a/src/storage/pinyin_base.cpp +++ b/src/storage/pinyin_base.cpp @@ -1384,8 +1384,7 @@ int pinyin_compare_initial (const PinyinCustomSettings &custom, (lhs == PINYIN_He && rhs == PINYIN_Fo))) ) return 0; - else if (lhs < rhs) return -1; - return 1; + else return (lhs - rhs); } int pinyin_compare_final (const PinyinCustomSettings &custom, @@ -1407,8 +1406,7 @@ int pinyin_compare_final (const PinyinCustomSettings &custom, return 0; else if (custom.use_incomplete && (lhs == PINYIN_ZeroFinal || rhs == PINYIN_ZeroFinal)) return 0; - else if (lhs < rhs) return -1; - return 1; + else return (lhs - rhs); } int pinyin_compare_tone (const PinyinCustomSettings &custom, @@ -1417,8 +1415,7 @@ int pinyin_compare_tone (const PinyinCustomSettings &custom, { if(lhs == rhs || !lhs || !rhs) return 0; - else if (lhs < rhs) return -1; - return 1; + else return (lhs - rhs); } }; |