HomePhabricator

refactor: net: avoid duplicate map lookups to `mapLocalHost`

Description

refactor: net: avoid duplicate map lookups to mapLocalHost

Summary:
Instead of calling count() (to first find out whether a key is in the map) and then operator[] (to get the value to the passed key, or default-construct one if not found), use either find() or emplace()`

This is a backport of core#22896

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13350

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Sep 5 2021, 22:10
PiRKCommitted on Mar 16 2023, 14:58
PiRKPushed on Mar 16 2023, 14:58
Reviewer
Restricted Project
Differential Revision
D13350: refactor: net: avoid duplicate map lookups to `mapLocalHost`
Parents
rABCc68cd65292d6: net: use member clientInterface rather than global uiInterface in CConman
Branches
Unknown
Tags
Unknown