diff options
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 3b3014ab5..99e564bc5 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -82,7 +82,7 @@ void LineLayout::Resize(int maxLineLength_) { } } -void LineLayout::Free() { +void LineLayout::Free() noexcept { chars.reset(); styles.reset(); positions.reset(); @@ -283,7 +283,7 @@ void LineLayoutCache::AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesI PLATFORM_ASSERT(cache.size() == lengthForLevel); } -void LineLayoutCache::Deallocate() { +void LineLayoutCache::Deallocate() noexcept { PLATFORM_ASSERT(useCount == 0); cache.clear(); } @@ -301,7 +301,7 @@ void LineLayoutCache::Invalidate(LineLayout::validLevel validity_) { } } -void LineLayoutCache::SetLevel(int level_) { +void LineLayoutCache::SetLevel(int level_) noexcept { allInvalidated = false; if ((level_ != -1) && (level != level_)) { level = level_; @@ -357,7 +357,7 @@ LineLayout *LineLayoutCache::Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, return ret; } -void LineLayoutCache::Dispose(LineLayout *ll) { +void LineLayoutCache::Dispose(LineLayout *ll) noexcept { allInvalidated = false; if (ll) { if (!ll->inCache) { @@ -380,7 +380,7 @@ static unsigned int KeyFromString(const char *charBytes, size_t len) { return k; } -SpecialRepresentations::SpecialRepresentations() { +SpecialRepresentations::SpecialRepresentations() noexcept { const short none = 0; std::fill(startByteHasReprs, std::end(startByteHasReprs), none); } @@ -556,11 +556,11 @@ TextSegment BreakFinder::Next() { } } -bool BreakFinder::More() const { +bool BreakFinder::More() const noexcept { return (subBreak >= 0) || (nextBreak < lineRange.end); } -PositionCacheEntry::PositionCacheEntry() : +PositionCacheEntry::PositionCacheEntry() noexcept : styleNumber(0), len(0), clock(0), positions(nullptr) { } @@ -593,7 +593,7 @@ PositionCacheEntry::~PositionCacheEntry() { Clear(); } -void PositionCacheEntry::Clear() { +void PositionCacheEntry::Clear() noexcept { positions.reset(); styleNumber = 0; len = 0; @@ -613,7 +613,7 @@ bool PositionCacheEntry::Retrieve(unsigned int styleNumber_, const char *s_, } } -unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) { +unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept { unsigned int ret = s[0] << 7; for (unsigned int i=0; i<len_; i++) { ret *= 1000003; @@ -626,11 +626,11 @@ unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, return ret; } -bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const { +bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const noexcept { return clock > other.clock; } -void PositionCacheEntry::ResetClock() { +void PositionCacheEntry::ResetClock() noexcept { if (clock > 0) { clock = 1; } @@ -646,7 +646,7 @@ PositionCache::~PositionCache() { Clear(); } -void PositionCache::Clear() { +void PositionCache::Clear() noexcept { if (!allClear) { for (PositionCacheEntry &pce : pces) { pce.Clear(); |