diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2014-12-20 18:35:54 +0000 |
---|---|---|
committer | warptangent <warptangent@inbox.com> | 2015-01-04 19:39:43 -0800 |
commit | 57b80c541e01df8ad83aa6f8611c2ebc5669c716 (patch) | |
tree | 340957ed9439319c197aaff1ec995cfe50bac3c1 /src | |
parent | blockchain_converter: add --testnet for converting testnet blockchain (diff) | |
download | monero-57b80c541e01df8ad83aa6f8611c2ebc5669c716.tar.xz |
db_lmdb: remove redundant checks
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp index e96b9f90f..ee5c0fa9b 100644 --- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp +++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp @@ -1162,12 +1162,9 @@ tx_out BlockchainLMDB::get_output(const crypto::hash& h, const uint64_t& index) mdb_cursor_get(cur, &k, &v, MDB_FIRST_DUP); - if (index != 0) + for (uint64_t i = 0; i < index; ++i) { - for (uint64_t i = 0; i < index; ++i) - { - mdb_cursor_get(cur, &k, &v, MDB_NEXT_DUP); - } + mdb_cursor_get(cur, &k, &v, MDB_NEXT_DUP); } mdb_cursor_get(cur, &k, &v, MDB_GET_CURRENT); @@ -1264,12 +1261,9 @@ tx_out_index BlockchainLMDB::get_output_tx_and_index(const uint64_t& amount, con mdb_cursor_get(cur, &k, &v, MDB_FIRST_DUP); - if (index != 0) + for (uint64_t i = 0; i < index; ++i) { - for (uint64_t i = 0; i < index; ++i) - { - mdb_cursor_get(cur, &k, &v, MDB_NEXT_DUP); - } + mdb_cursor_get(cur, &k, &v, MDB_NEXT_DUP); } mdb_cursor_get(cur, &k, &v, MDB_GET_CURRENT); |