fix compare bug
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@639 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
85a490c387
commit
cdc9205e8e
1 changed files with 3 additions and 1 deletions
|
@ -217,6 +217,8 @@ public:
|
||||||
private:
|
private:
|
||||||
static size_type Min(size_type lhs, size_type rhs)
|
static size_type Min(size_type lhs, size_type rhs)
|
||||||
{ return lhs < rhs ? lhs : rhs; }
|
{ return lhs < rhs ? lhs : rhs; }
|
||||||
|
static size_type Max(size_type lhs, size_type rhs)
|
||||||
|
{ return lhs > rhs ? lhs : rhs; }
|
||||||
static void Procust(size_type& n, size_type nmax)
|
static void Procust(size_type& n, size_type nmax)
|
||||||
{ if (n > nmax) n = nmax; }
|
{ if (n > nmax) n = nmax; }
|
||||||
|
|
||||||
|
@ -1093,7 +1095,7 @@ public:
|
||||||
|
|
||||||
int compare(const value_type* s) const
|
int compare(const value_type* s) const
|
||||||
{
|
{
|
||||||
return traits_type::compare(data(), s, traits_type::length(s));
|
return traits_type::compare(data(), s, Max(length(),traits_type::length(s)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue