Skip to content

Commit

Permalink
Merge bitcoin#13767: Remove redundant assignments (dead stores)
Browse files Browse the repository at this point in the history
dd777f3 Remove unused variable (practicalswift)
cdf4089 Remove redundant assignments (dead stores) (practicalswift)

Pull request description:

  Remove redundant assignments (dead stores).

Tree-SHA512: e852059b22a161c34a0f18a6a6ed798e2b35e6d2b9f23c526af0ec33e01f6a5bb1fa5ada6671ba183d7b02393ff0d397be5aa4b4e2edbd5e604c9a76ac48d249

# Conflicts:
#	src/test/descriptor_tests.cpp
#	src/txmempool.cpp
  • Loading branch information
MarcoFalke authored and Munkybooty committed Jun 30, 2021
1 parent a29d3d4 commit bb592c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/bench/crypto_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,16 @@ static void HASH_SipHash_0032b(benchmark::State& state)
static void FastRandom_32bit(benchmark::State& state)
{
FastRandomContext rng(true);
uint32_t x = 0;
while (state.KeepRunning()) {
x += rng.rand32();
rng.rand32();
}
}

static void FastRandom_1bit(benchmark::State& state)
{
FastRandomContext rng(true);
uint32_t x = 0;
while (state.KeepRunning()) {
x += rng.randbool();
rng.randbool();
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/bench/rollingbloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static void RollingBloom(benchmark::State& state)
CRollingBloomFilter filter(120000, 0.000001);
std::vector<unsigned char> data(32);
uint32_t count = 0;
uint64_t match = 0;
while (state.KeepRunning()) {
count++;
data[0] = count;
Expand All @@ -25,7 +24,7 @@ static void RollingBloom(benchmark::State& state)
data[1] = count >> 16;
data[2] = count >> 8;
data[3] = count;
match += filter.contains(data);
filter.contains(data);
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/test/script_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,17 +895,19 @@ BOOST_AUTO_TEST_CASE(script_build)
}
}

#ifdef UPDATE_JSON_TESTS
std::string strGen;

#endif
for (TestBuilder& test : tests) {
test.Test();
std::string str = JSONPrettyPrint(test.GetJSON());
#ifndef UPDATE_JSON_TESTS
#ifdef UPDATE_JSON_TESTS
strGen += str + ",\n";
#else
if (tests_set.count(str) == 0) {
BOOST_CHECK_MESSAGE(false, "Missing auto script_valid test: " + test.GetComment());
}
#endif
strGen += str + ",\n";
}

#ifdef UPDATE_JSON_TESTS
Expand Down
1 change: 1 addition & 0 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
const CTransaction& tx2 = it2->GetTx();
assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull());
fDependsWait = true;
setParentCheck.insert(it2);
if (setParentCheck.insert(it2).second) {
parentSizes += it2->GetTxSize();
parentSigOpCount += it2->GetSigOpCount();
Expand Down

0 comments on commit bb592c2

Please sign in to comment.