diff options
author | Oran Juice <oranjuices@hotmail.com> | 2014-10-02 21:35:27 +0530 |
---|---|---|
committer | Oran Juice <oranjuices@hotmail.com> | 2014-10-02 21:45:31 +0530 |
commit | d683c8c724b59b2e8d01dcb45698c44b08186813 (patch) | |
tree | f226453543492862a2c9cd15b18c0a5545f2397e /src/mnemonics/electrum-words.cpp | |
parent | Cut short word lists to 1626 words, added attribution to Electrum, some bug f... (diff) | |
download | monero-d683c8c724b59b2e8d01dcb45698c44b08186813.tar.xz |
Use reference types on LHS when using language methods
Diffstat (limited to 'src/mnemonics/electrum-words.cpp')
-rw-r--r-- | src/mnemonics/electrum-words.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp index e644e0cbf..053941194 100644 --- a/src/mnemonics/electrum-words.cpp +++ b/src/mnemonics/electrum-words.cpp @@ -95,14 +95,13 @@ namespace it->substr(0, Language::unique_prefix_length) : *it); } } - std::unordered_map<std::string, uint32_t> word_map; - std::unordered_map<std::string, uint32_t> trimmed_word_map; + // Iterate through all the languages and find a match for (std::vector<Language::Base*>::iterator it1 = language_instances.begin(); it1 != language_instances.end(); it1++) { - word_map = (*it1)->get_word_map(); - trimmed_word_map = (*it1)->get_trimmed_word_map(); + std::unordered_map<std::string, uint32_t> &word_map = (*it1)->get_word_map(); + std::unordered_map<std::string, uint32_t> &trimmed_word_map = (*it1)->get_trimmed_word_map(); // To iterate through seed words std::vector<std::string>::const_iterator it2; // To iterate through trimmed seed words @@ -285,7 +284,6 @@ namespace crypto if (sizeof(src.data) % 4 != 0 || sizeof(src.data) == 0) return false; - std::vector<std::string> word_list; Language::Base *language; if (language_name == "English") { @@ -307,7 +305,7 @@ namespace crypto { return false; } - word_list = language->get_word_list(); + std::vector<std::string> &word_list = language->get_word_list(); // To store the words for random access to add the checksum word later. std::vector<std::string> words_store; |