Updated to fix errors with not clearing strings during encoding/decoding

This commit is contained in:
2018-05-14 13:46:37 -04:00
parent dc85d6b5bc
commit c8c56ef159
4 changed files with 10 additions and 5 deletions

View File

@@ -123,6 +123,7 @@ std::vector<unsigned int> Vigenere::getOffsets() const{
* @return The encoded message
*/
std::string Vigenere::encode(){
outputString = "";
//Reserve the correct size for the output string to increase speed for longer messages
outputString.reserve(inputString.size());
@@ -167,6 +168,7 @@ std::string Vigenere::encode(std::string key, std::string input){
* @return The decoded message
*/
std::string Vigenere::decode(){
outputString = "";
//Reserve the correct size for the output string to increase speed for longer messages
outputString.reserve(inputString.size());