diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-02-19 09:24:29 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-19 09:56:29 +0100 |
commit | 6e619198cbd132300a9219c1de64a4750ca5a092 (patch) | |
tree | 2322e558932c16e87db75b0861584d1442fd85d0 | |
parent | 18138417485aeba6c52d935c616dba829b24ffd8 (diff) |
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: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 63b402ffad53..81143ce33b5a 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -508,12 +508,7 @@ bool WrongList::DbgIsBuggy() const { for (WrongList::const_iterator j = i + 1; !bError && (j != maRanges.end()); ++j) { - // 1) Start before, End after the second Start - 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; + bError = i->mnStart <= j->mnEnd && j->mnStart <= i->mnEnd; } } return bError; |