From 9af732945ce002123d9a036405310a66b427fa10 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Thu, 21 Oct 2021 02:00:00 +0000 Subject: [PATCH] clang-format and clang-tidy fixes for 6e5b6be0 --- ciphers/a1z26_cipher.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ciphers/a1z26_cipher.cpp b/ciphers/a1z26_cipher.cpp index 7bd0558a1..dda21e757 100644 --- a/ciphers/a1z26_cipher.cpp +++ b/ciphers/a1z26_cipher.cpp @@ -73,7 +73,7 @@ std::string encrypt(std::string text) { * not * @returns the decrypted string in all uppercase or all lowercase */ -std::string decrypt(std::string text, bool bReturnUppercase = false) { +std::string decrypt(const std::string& text, bool bReturnUppercase = false) { std::string result; // split words seperated by spaces into a vector array @@ -84,18 +84,18 @@ std::string decrypt(std::string text, bool bReturnUppercase = false) { word_array.push_back(word); } - for (int i = 0; i < word_array.size(); i++) { - std::replace(word_array[i].begin(), word_array[i].end(), '-', ' '); + for (auto& i : word_array) { + std::replace(i.begin(), i.end(), '-', ' '); std::vector text_array; - std::stringstream ss(word_array[i]); + std::stringstream ss(i); std::string res_text; while (ss >> res_text) { text_array.push_back(res_text); } - for (int i = 0; i < text_array.size(); i++) { - result += a1z26_decrypt_map[stoi(text_array[i])]; + for (auto& i : text_array) { + result += a1z26_decrypt_map[stoi(i)]; } result += ' ';