Commit 4d45b3e7 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #1089 from SpecLad:contract-violations

parents 70deda35 0daf4b80
......@@ -580,6 +580,8 @@ String::~String()
inline
String& String::operator=(const String& str)
{
if (&str == this) return *this;
deallocate();
if (str.cstr_) CV_XADD(((int*)str.cstr_)-1, 1);
cstr_ = str.cstr_;
......
......@@ -136,18 +136,13 @@ void CommandLineParser::getByIndex(int index, bool space_delete, int type, void*
static bool cmp_params(const CommandLineParserParams & p1, const CommandLineParserParams & p2)
{
if (p1.number < p2.number)
return true;
if (p1.number > p2.number)
return false;
if (p1.number == -1 && p2.number == -1)
{
if (p1.keys[0].compare(p2.keys[0]) > 0)
{
return false;
}
}
return true;
return p1.keys[0].compare(p2.keys[0]) < 0;
}
CommandLineParser::CommandLineParser(int argc, const char* const argv[], const String& keys)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment