From 284a2b4f936118059ab1c28197472c683ff90b94 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 17 Dec 2024 21:45:14 +0100 Subject: [PATCH] Reduce overhead when returning device display name --- syncthingconnector/syncthingdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncthingconnector/syncthingdev.h b/syncthingconnector/syncthingdev.h index fcf67800..4802d287 100644 --- a/syncthingconnector/syncthingdev.h +++ b/syncthingconnector/syncthingdev.h @@ -37,7 +37,7 @@ struct LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingDev { bool isConnected() const; SyncthingDevStatus computeConnectedStateAccordingToCompletion() const; SyncthingDevStatus setConnectedStateAccordingToCompletion(); - const QString displayName() const; + const QString &displayName() const; QString id; QString name; @@ -88,7 +88,7 @@ inline SyncthingDevStatus SyncthingDev::setConnectedStateAccordingToCompletion() return status = computeConnectedStateAccordingToCompletion(); } -inline const QString SyncthingDev::displayName() const +inline const QString &SyncthingDev::displayName() const { return name.isEmpty() ? id : name; }