diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-09 16:55:17 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-09 16:55:17 +1000 |
commit | da34a05d99e324ffc3ca802ca9d65db2a4e7eac9 (patch) | |
tree | c0a586a232d664f3252e697fa98d840993490f3f /src/PositionCache.cxx | |
parent | 1b763e30f00b6f03d506bf1e1fa0c6cb5264205e (diff) | |
download | scintilla-mirror-da34a05d99e324ffc3ca802ca9d65db2a4e7eac9.tar.gz |
Further use of range-for.
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; } |