aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2018-09-26 08:56:24 +1000
committerZufu Liu <unknown>2018-09-26 08:56:24 +1000
commit645840edc9a64128f2a4d79c4da6db00ce47cf0b (patch)
treefd437d03fbc9e62494574d185ced68d8d8711cd9 /src/PositionCache.cxx
parent44d2cc4516ae7117056ca1c64df2607349116824 (diff)
downloadscintilla-mirror-645840edc9a64128f2a4d79c4da6db00ce47cf0b.tar.gz
Bug [#2046]. Optimize setting up representation.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index ef26d236e..c5063ca10 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -494,13 +494,14 @@ SpecialRepresentations::SpecialRepresentations() {
}
void SpecialRepresentations::SetRepresentation(const char *charBytes, const char *value) {
- MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, UTF8MaxBytes));
+ const unsigned int key = KeyFromString(charBytes, UTF8MaxBytes);
+ MapRepresentation::iterator it = mapReprs.find(key);
if (it == mapReprs.end()) {
// New entry so increment for first byte
const unsigned char ucStart = charBytes[0];
startByteHasReprs[ucStart]++;
}
- mapReprs[KeyFromString(charBytes, UTF8MaxBytes)] = Representation(value);
+ mapReprs[key] = Representation(value);
}
void SpecialRepresentations::ClearRepresentation(const char *charBytes) {