ZRCola::index::compare_sort()
reverts to compare()
by default now
This commit is contained in:
parent
0d30a89d22
commit
e3c6a01722
@ -182,7 +182,11 @@ namespace ZRCola {
|
|||||||
/// - =0 when a == b
|
/// - =0 when a == b
|
||||||
/// - >0 when a > b
|
/// - >0 when a > b
|
||||||
///
|
///
|
||||||
virtual int compare_sort(_In_ const T_data &a, _In_ const T_data &b) const = 0;
|
virtual int compare_sort(_In_ const T_data &a, _In_ const T_data &b) const
|
||||||
|
{
|
||||||
|
// Revert to `compare()` by default.
|
||||||
|
return compare(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -238,27 +238,6 @@ namespace ZRCola {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
|
||||||
/// Compares two languages by ID (for sorting)
|
|
||||||
///
|
|
||||||
/// \param[in] a Pointer to first element
|
|
||||||
/// \param[in] b Pointer to second element
|
|
||||||
///
|
|
||||||
/// \returns
|
|
||||||
/// - <0 when a < b
|
|
||||||
/// - =0 when a == b
|
|
||||||
/// - >0 when a > b
|
|
||||||
///
|
|
||||||
virtual int compare_sort(_In_ const language &a, _In_ const language &b) const
|
|
||||||
{
|
|
||||||
int r = memcmp(a.id, b.id, sizeof(langid_t));
|
|
||||||
if (r != 0) return r;
|
|
||||||
|
|
||||||
// As the language ID must not duplicate, further comparison is pointless.
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
} idxLng; ///< Language index
|
} idxLng; ///< Language index
|
||||||
|
|
||||||
std::vector<unsigned __int16> data; ///< Language data
|
std::vector<unsigned __int16> data; ///< Language data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user