aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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
commit287285fa7def8bef54885d596b4cbef234d3f34a (patch)
treecbd88f38a025cbf4a54c1e53e986e77e51fac875 /src
parente95830ea8681727d86665d06dd1689019a01a335 (diff)
downloadscintilla-mirror-287285fa7def8bef54885d596b4cbef234d3f34a.tar.gz
Backport: Bug [#2046]. Optimize setting up representation.
Backport of changeset 7096:60dee13d68b2.
Diffstat (limited to 'src')
-rw-r--r--src/PositionCache.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index ec8de83ba..e27699bfe 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -386,13 +386,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) {