aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/SparseVector.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-05-21 10:26:10 +1000
committerNeil <nyamatongwe@gmail.com>2017-05-21 10:26:10 +1000
commit8ef4f3d54de1328a1d9753f4317a5d7692a72ae8 (patch)
treed0fb1e0c6cbd0a0256066ccb9e1541d3adbdf41c /src/SparseVector.h
parent632801dae9d844bd73891a314e99161add3f47fc (diff)
downloadscintilla-mirror-8ef4f3d54de1328a1d9753f4317a5d7692a72ae8.tar.gz
Make SplitVector work with move-only types like unique_ptr.
Provide InsertEmpty and both const and non-const reference returning operator[]. Add and fix comments.
Diffstat (limited to 'src/SparseVector.h')
-rw-r--r--src/SparseVector.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SparseVector.h b/src/SparseVector.h
index 39324bdc1..ce38d0da1 100644
--- a/src/SparseVector.h
+++ b/src/SparseVector.h
@@ -163,7 +163,8 @@ template<>
inline void SparseVector<const char *>::ClearValue(int partition) {
const char *value = values->ValueAt(partition);
delete []value;
- values->SetValueAt(partition, NULL);
+ value = nullptr;
+ values->SetValueAt(partition, value);
}
template<>
@@ -175,7 +176,7 @@ inline void SparseVector<const char *>::SetValueAt(int position, const char *val
std::copy(value, value + len, valueCopy);
CommonSetValueAt(position, valueCopy);
} else {
- CommonSetValueAt(position, NULL);
+ CommonSetValueAt(position, nullptr);
}
}