perf: small perf changes in HidChooserController (#39057)

* perf: avoid string temporary in HidChooserController::PhysicalDeviceIdFromDeviceInfo()

return a const ref instead of a new string

* perf: avoid second map lookup in HidChooserController::AddDeviceInfo()
This commit is contained in:
Charles Kerr 2023-07-19 09:54:30 -05:00 committed by GitHub
parent cc39ddb728
commit f2b32af1f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 18 deletions

View file

@ -54,7 +54,7 @@ class HidChooserController
~HidChooserController() override;
// static
static std::string PhysicalDeviceIdFromDeviceInfo(
static const std::string& PhysicalDeviceIdFromDeviceInfo(
const device::mojom::HidDeviceInfo& device);
// HidChooserContext::DeviceObserver: