Skip to content

Commit 6a318e4

Browse files
Reduce variable scopes
1 parent 7466a26 commit 6a318e4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/qt/recentrequeststablemodel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex
139139

140140
if(count > 0 && row >= 0 && (row+count) <= list.size())
141141
{
142-
const RecentRequestEntry *rec;
143142
for (int i = 0; i < count; ++i)
144143
{
145-
rec = &list[row+i];
144+
const RecentRequestEntry* rec = &list[row+i];
146145
if (!walletModel->saveReceiveRequest(rec->recipient.address.toStdString(), rec->id, ""))
147146
return false;
148147
}

src/test/test_bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
145145
for (const CMutableTransaction& tx : txns)
146146
block.vtx.push_back(MakeTransactionRef(tx));
147147
// IncrementExtraNonce creates a valid coinbase and merkleRoot
148-
unsigned int extraNonce = 0;
149148
{
150149
LOCK(cs_main);
150+
unsigned int extraNonce = 0;
151151
IncrementExtraNonce(&block, chainActive.Tip(), extraNonce);
152152
}
153153

src/test/util_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,8 @@ static constexpr char ExitCommand = 'X';
704704
static void TestOtherProcess(fs::path dirname, std::string lockname, int fd)
705705
{
706706
char ch;
707-
int rv;
708707
while (true) {
709-
rv = read(fd, &ch, 1); // Wait for command
708+
int rv = read(fd, &ch, 1); // Wait for command
710709
assert(rv == 1);
711710
switch(ch) {
712711
case LockCommand:

0 commit comments

Comments
 (0)