From cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Sep 2012 19:28:16 +0300 Subject: Add const to variables with type size_t. --- src/resources/dye.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/resources/dye.cpp') diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 4cedafd4e..4b5c1268c 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -282,10 +282,11 @@ Dye::Dye(const std::string &description) if (description.empty()) return; - size_t next_pos = 0, length = description.length(); + size_t next_pos = 0; + const size_t length = description.length(); do { - size_t pos = next_pos; + const size_t pos = next_pos; next_pos = description.find(';', pos); if (next_pos == std::string::npos) @@ -367,7 +368,7 @@ void Dye::instantiate(std::string &target, const std::string &palettes) size_t last_pos = target.length(), pal_pos = 0; do { - size_t pos = next_pos; + const size_t pos = next_pos; next_pos = target.find(';', pos); if (next_pos == std::string::npos) @@ -375,7 +376,7 @@ void Dye::instantiate(std::string &target, const std::string &palettes) if (next_pos == pos + 1 && pal_pos != std::string::npos) { - size_t pal_next_pos = palettes.find(';', pal_pos); + const size_t pal_next_pos = palettes.find(';', pal_pos); s << target[pos] << ':'; if (pal_next_pos == std::string::npos) { -- cgit v1.2.3-60-g2f50