aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/SparseState.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-02-10 23:28:29 +1100
committernyamatongwe <devnull@localhost>2011-02-10 23:28:29 +1100
commit73ab73b08eb3f5523d05a3a0dd55701a19168498 (patch)
tree05450a7c8fa0fb770ef03d6a6ec4600d3857002d /lexlib/SparseState.h
parent24b684b8df2786ac97ddc01f5f670b4003c59428 (diff)
downloadscintilla-mirror-73ab73b08eb3f5523d05a3a0dd55701a19168498.tar.gz
Only append a state if the value differs from the last current value.
Diffstat (limited to 'lexlib/SparseState.h')
-rw-r--r--lexlib/SparseState.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lexlib/SparseState.h b/lexlib/SparseState.h
index 39b6e605a..953800a44 100644
--- a/lexlib/SparseState.h
+++ b/lexlib/SparseState.h
@@ -30,7 +30,9 @@ class SparseState {
public:
void Set(int position, T value) {
Delete(position);
- states.push_back(State(position, value));
+ if ((states.size() == 0) || (value != states[states.size()-1].value)) {
+ states.push_back(State(position, value));
+ }
}
T ValueAt(int position) {
if (!states.size())