Skip to content

Commit

Permalink
Avoid asmap copies in initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa authored and furszy committed Jul 28, 2021
1 parent cb698fb commit 868a6ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,8 @@ bool AppInitMain()
UIError(strprintf(_("Could not find or parse specified asmap: '%s'"), asmap_path));
return false;
}
connman.SetAsmap(asmap);
const uint256 asmap_version = SerializeHash(asmap);
connman.SetAsmap(std::move(asmap));
LogPrintf("Using asmap version %s for IP bucketing.\n", asmap_version.ToString());
} else {
LogPrintf("Using /16 prefix for IP bucketing.\n");
Expand Down
2 changes: 1 addition & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class CConnman

unsigned int GetReceiveFloodSize() const;

void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = asmap; }
void SetAsmap(std::vector<bool> asmap) { addrman.m_asmap = std::move(asmap); }
private:
struct ListenSocket {
SOCKET socket;
Expand Down

0 comments on commit 868a6ed

Please sign in to comment.