diff options
author | nyamatongwe <unknown> | 2011-02-10 23:28:29 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-02-10 23:28:29 +1100 |
commit | b220217bd33097be440f6dd62e5c6d69f0256773 (patch) | |
tree | 90576c53d5d79381761ac5aa369f85e4dbcec102 /lexlib/SparseState.h | |
parent | e4e7a926111f9644542cec4549a65fd349a879de (diff) | |
download | scintilla-mirror-b220217bd33097be440f6dd62e5c6d69f0256773.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.h | 4 |
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()) |