From 9766f61f7bb496c6e304aaef2661421327ecf8a7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 Jan 2021 17:54:09 +0100 Subject: [PATCH] su+passwd: Don't copy Core::Account unnecessarily --- Userland/passwd.cpp | 2 +- Userland/su.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/passwd.cpp b/Userland/passwd.cpp index 5e9ed17e4b..3ec586adc0 100644 --- a/Userland/passwd.cpp +++ b/Userland/passwd.cpp @@ -108,7 +108,7 @@ int main(int argc, char** argv) } // target_account is the account we are changing the password of. - auto target_account = account_or_error.value(); + auto& target_account = account_or_error.value(); if (current_uid != 0 && current_uid != target_account.uid()) { fprintf(stderr, "You can't modify passwd for %s\n", username); diff --git a/Userland/su.cpp b/Userland/su.cpp index a91e67518b..070070bf04 100644 --- a/Userland/su.cpp +++ b/Userland/su.cpp @@ -68,7 +68,7 @@ int main(int argc, char** argv) return 1; } - Core::Account account = account_or_error.value(); + const auto& account = account_or_error.value(); if (getuid() != 0 && account.has_password()) { auto password = Core::get_password();