Skip to content

Commit d58bcdc

Browse files
committed
Avoid asmap copies in initialization
1 parent 7fcaa82 commit d58bcdc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,8 +1832,8 @@ bool AppInitMain(NodeContext& node)
18321832
InitError(strprintf(_("Could not find or parse specified asmap: '%s'").translated, asmap_path));
18331833
return false;
18341834
}
1835-
node.connman->SetAsmap(asmap);
18361835
const uint256 asmap_version = SerializeHash(asmap);
1836+
node.connman->SetAsmap(std::move(asmap));
18371837
LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString());
18381838
} else {
18391839
LogPrintf("Using /16 prefix for IP bucketing.\n");

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class CConnman
331331
*/
332332
int64_t PoissonNextSendInbound(int64_t now, int average_interval_seconds);
333333

334-
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = asmap; }
334+
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = std::move(asmap); }
335335

336336
private:
337337
struct ListenSocket {

0 commit comments

Comments
 (0)