aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-05-15 17:18:59 +1000
committerNeil <nyamatongwe@gmail.com>2021-05-15 17:18:59 +1000
commit98e6b6ff51e05ae08e31c81954ff10dfb7191be5 (patch)
treee64b38e41d43bdfc37f69daeb600f7e7b0371e91 /src/PositionCache.cxx
parentad7f10a29853beb17663e72e6fd18e8977ebec42 (diff)
downloadscintilla-mirror-98e6b6ff51e05ae08e31c81954ff10dfb7191be5.tar.gz
Protect against out-of-bounds layout cache level and remove unnecessary code.
Make documentation more accurate.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index c1e0a77bd..1839f2072 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -463,8 +463,7 @@ void LineLayoutCache::Invalidate(LineLayout::ValidLevel validity_) noexcept {
}
void LineLayoutCache::SetLevel(Cache level_) noexcept {
- allInvalidated = false;
- if ((static_cast<int>(level_) != -1) && (level != level_)) {
+ if (level != level_) {
level = level_;
allInvalidated = false;
cache.clear();