From 2f7a01849e698b3d63e79d7e8bf04a6346fa248e Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 29 Jan 2018 17:32:36 +0000 Subject: Remove redundant checks in CPVT_WordRange::Intersect(). BUG=chromium:805881 Change-Id: I5ff76067fb26198df13482e6c475138142b3f6c5 Reviewed-on: https://pdfium-review.googlesource.com/24192 Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- core/fpdfdoc/cpvt_wordrange.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/fpdfdoc/cpvt_wordrange.h b/core/fpdfdoc/cpvt_wordrange.h index 638f6c17c0..5426154783 100644 --- a/core/fpdfdoc/cpvt_wordrange.h +++ b/core/fpdfdoc/cpvt_wordrange.h @@ -43,10 +43,8 @@ struct CPVT_WordRange { } CPVT_WordRange Intersect(const CPVT_WordRange& that) const { - if (that.EndPos < BeginPos || that.BeginPos > EndPos || - EndPos < that.BeginPos || BeginPos > that.EndPos) { + if (that.EndPos < BeginPos || that.BeginPos > EndPos) return CPVT_WordRange(); - } return CPVT_WordRange(std::max(BeginPos, that.BeginPos), std::min(EndPos, that.EndPos)); -- cgit v1.2.3