summaryrefslogtreecommitdiff
path: root/lib/persistence.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-11-27 00:36:19 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-27 00:36:25 +0000
commit7827b06edf6a0629eb659540595c347965abfb88 (patch)
tree3b52612ae8f591f23e2b179fe817f4d4c948a7ce /lib/persistence.h
parentEnable all Jason Turner recommended warnings (diff)
downloadilt-7827b06edf6a0629eb659540595c347965abfb88.tar.bz2
ilt-7827b06edf6a0629eb659540595c347965abfb88.tar.xz
ilt-7827b06edf6a0629eb659540595c347965abfb88.zip
Fix up lots of static analyzer warnings
Diffstat (limited to 'lib/persistence.h')
-rw-r--r--lib/persistence.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/persistence.h b/lib/persistence.h
index 0faa24d..5468cd3 100644
--- a/lib/persistence.h
+++ b/lib/persistence.h
@@ -176,11 +176,11 @@ namespace Persistence {
void
write(const Writer & out) const override
{
- for (glm::length_t idx = 0; idx < L; idx += 1) {
- if (idx) {
+ for (glm::length_t n = 0; n < L; n += 1) {
+ if (n) {
out.nextValue();
}
- SelectionT<T> {this->v[idx]}.write(out);
+ SelectionT<T> {this->v[n]}.write(out);
}
}
};
@@ -217,11 +217,11 @@ namespace Persistence {
void
write(const Writer & out) const override
{
- for (std::size_t idx = 0; idx < this->v.size(); idx += 1) {
- if (idx) {
+ for (auto & member : this->v) {
+ if (&member != &this->v.front()) {
out.nextValue();
}
- SelectionT<T> {this->v[idx]}.write(out);
+ SelectionT<T> {member}.write(out);
}
}
};