Kaydet (Commit) 6e619198 authored tarafından Arkadiy Illarionov's avatar Arkadiy Illarionov Kaydeden (comit) Noel Grandin

Simplify ranges overlapping condition

Using conjuction and disjuction distributivity and assuming
that for each range r: r.mnStart <= r.mnEnd.

Change-Id: Ifbd156426617ebf225b1b1139e17e4967a228cd6
Reviewed-on: https://gerrit.libreoffice.org/68003
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 18138417
...@@ -508,12 +508,7 @@ bool WrongList::DbgIsBuggy() const ...@@ -508,12 +508,7 @@ bool WrongList::DbgIsBuggy() const
{ {
for (WrongList::const_iterator j = i + 1; !bError && (j != maRanges.end()); ++j) for (WrongList::const_iterator j = i + 1; !bError && (j != maRanges.end()); ++j)
{ {
// 1) Start before, End after the second Start bError = i->mnStart <= j->mnEnd && j->mnStart <= i->mnEnd;
if (i->mnStart <= j->mnStart && i->mnEnd >= j->mnStart)
bError = true;
// 2) Start after the second Start, but still before the second End
else if (i->mnStart >= j->mnStart && i->mnStart <= j->mnEnd)
bError = true;
} }
} }
return bError; return bError;
......
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