Skip to content

Commit 868a6ed

Browse files
sipafurszy
authored andcommitted
Avoid asmap copies in initialization
1 parent cb698fb commit 868a6ed

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
@@ -1979,8 +1979,8 @@ bool AppInitMain()
19791979
UIError(strprintf(_("Could not find or parse specified asmap: '%s'"), asmap_path));
19801980
return false;
19811981
}
1982-
connman.SetAsmap(asmap);
19831982
const uint256 asmap_version = SerializeHash(asmap);
1983+
connman.SetAsmap(std::move(asmap));
19841984
LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString());
19851985
} else {
19861986
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
@@ -271,7 +271,7 @@ class CConnman
271271

272272
unsigned int GetReceiveFloodSize() const;
273273

274-
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = asmap; }
274+
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = std::move(asmap); }
275275
private:
276276
struct ListenSocket {
277277
SOCKET socket;

0 commit comments

Comments
 (0)