aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-07-29 09:27:10 +1000
committerNeil <nyamatongwe@gmail.com>2021-07-29 09:27:10 +1000
commit6a83f1fc22a5dc0a65c7b7f7af81e753c557b25b (patch)
treee813df40df3545980f9453a999ae790be8dd6958 /src/PositionCache.cxx
parentff085a4ce95380e9d981e0170e2d1eeaa93fdb88 (diff)
downloadscintilla-mirror-6a83f1fc22a5dc0a65c7b7f7af81e753c557b25b.tar.gz
Make iterators const where possible.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 1497adee7..714937dc1 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -554,7 +554,7 @@ constexpr unsigned int representationKeyCrLf = KeyFromString("\r\n");
void SpecialRepresentations::SetRepresentation(std::string_view charBytes, std::string_view value) {
if ((charBytes.length() <= 4) && (value.length() <= Representation::maxLength)) {
const unsigned int key = KeyFromString(charBytes);
- MapRepresentation::iterator it = mapReprs.find(key);
+ const MapRepresentation::iterator it = mapReprs.find(key);
if (it == mapReprs.end()) {
// New entry so increment for first byte
const unsigned char ucStart = charBytes.empty() ? 0 : charBytes[0];
@@ -570,7 +570,7 @@ void SpecialRepresentations::SetRepresentation(std::string_view charBytes, std::
void SpecialRepresentations::SetRepresentationAppearance(std::string_view charBytes, RepresentationAppearance appearance) {
if (charBytes.length() <= 4) {
const unsigned int key = KeyFromString(charBytes);
- MapRepresentation::iterator it = mapReprs.find(key);
+ const MapRepresentation::iterator it = mapReprs.find(key);
if (it == mapReprs.end()) {
// Not present so fail
return;
@@ -582,7 +582,7 @@ void SpecialRepresentations::SetRepresentationAppearance(std::string_view charBy
void SpecialRepresentations::SetRepresentationColour(std::string_view charBytes, ColourRGBA colour) {
if (charBytes.length() <= 4) {
const unsigned int key = KeyFromString(charBytes);
- MapRepresentation::iterator it = mapReprs.find(key);
+ const MapRepresentation::iterator it = mapReprs.find(key);
if (it == mapReprs.end()) {
// Not present so fail
return;
@@ -595,7 +595,7 @@ void SpecialRepresentations::SetRepresentationColour(std::string_view charBytes,
void SpecialRepresentations::ClearRepresentation(std::string_view charBytes) {
if (charBytes.length() <= 4) {
const unsigned int key = KeyFromString(charBytes);
- MapRepresentation::iterator it = mapReprs.find(key);
+ const MapRepresentation::iterator it = mapReprs.find(key);
if (it != mapReprs.end()) {
mapReprs.erase(it);
const unsigned char ucStart = charBytes.empty() ? 0 : charBytes[0];
@@ -608,7 +608,7 @@ void SpecialRepresentations::ClearRepresentation(std::string_view charBytes) {
}
const Representation *SpecialRepresentations::GetRepresentation(std::string_view charBytes) const {
- MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes));
+ const MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes));
if (it != mapReprs.end()) {
return &(it->second);
}
@@ -630,7 +630,7 @@ bool SpecialRepresentations::Contains(std::string_view charBytes) const {
const unsigned char ucStart = charBytes.empty() ? 0 : charBytes[0];
if (!startByteHasReprs[ucStart])
return false;
- MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes));
+ const MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes));
return it != mapReprs.end();
}