diff options
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 1b69fccdb..6df915b8b 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -293,16 +293,16 @@ void LineLayoutCache::AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesI void LineLayoutCache::Deallocate() { PLATFORM_ASSERT(useCount == 0); - for (size_t i = 0; i < cache.size(); i++) - delete cache[i]; + for (LineLayout *ll : cache) + delete ll; cache.clear(); } void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) { if (!cache.empty() && !allInvalidated) { - for (size_t i = 0; i < cache.size(); i++) { - if (cache[i]) { - cache[i]->Invalidate(validity_); + for (LineLayout *ll : cache) { + if (ll) { + ll->Invalidate(validity_); } } if (validity_ == LineLayout::llInvalid) { @@ -482,7 +482,7 @@ BreakFinder::BreakFinder(const LineLayout *ll_, const Selection *psel, Range lin } } } - if (pvsDraw && pvsDraw->indicatorsSetFore > 0) { + if (pvsDraw && pvsDraw->indicatorsSetFore) { for (Decoration *deco = pdoc->decorations.Root(); deco; deco = deco->Next()) { if (pvsDraw->indicators[deco->Indicator()].OverridesTextFore()) { Sci::Position startPos = deco->rs.EndRun(posLineStart); @@ -639,8 +639,8 @@ PositionCache::~PositionCache() { void PositionCache::Clear() { if (!allClear) { - for (size_t i=0; i<pces.size(); i++) { - pces[i].Clear(); + for (PositionCacheEntry &pce : pces) { + pce.Clear(); } } clock = 1; @@ -700,8 +700,8 @@ void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, uns if (clock > 60000) { // Since there are only 16 bits for the clock, wrap it round and // reset all cache entries so none get stuck with a high clock. - for (size_t i=0; i<pces.size(); i++) { - pces[i].ResetClock(); + for (PositionCacheEntry &pce : pces) { + pce.ResetClock(); } clock = 2; } |