From 7827b06edf6a0629eb659540595c347965abfb88 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Nov 2021 00:36:19 +0000 Subject: Fix up lots of static analyzer warnings --- lib/persistence.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/persistence.h') 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 {this->v[idx]}.write(out); + SelectionT {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 {this->v[idx]}.write(out); + SelectionT {member}.write(out); } } }; -- cgit v1.2.3