mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Re-removed the clear checks for the class strings when adding to them
This commit is contained in:
@@ -79,6 +79,8 @@ void Vigenere::setKeyword(std::string key){
|
||||
}
|
||||
//If it is not a letter ignore it
|
||||
}
|
||||
//Make sure offset is empty before adding to it
|
||||
offset.clear();
|
||||
setOffset();
|
||||
}
|
||||
|
||||
@@ -96,8 +98,6 @@ std::string Vigenere::getKeyword() const{
|
||||
*
|
||||
*/
|
||||
void Vigenere::setOffset(){
|
||||
//Make sure offset is empty
|
||||
offset.clear();
|
||||
//Reserve the correct size to increase speed later
|
||||
offset.reserve(keyword.size());
|
||||
|
||||
@@ -123,7 +123,6 @@ 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());
|
||||
|
||||
@@ -168,7 +167,6 @@ 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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user