summaryrefslogtreecommitdiff
path: root/Userland/Utilities/file.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-07 14:33:17 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-07 15:43:23 +0100
commita9fcdc767e7a2a37147bb14b02098e620dec47f7 (patch)
tree40f2260f0277d90fb4a171db84140eb13be73395 /Userland/Utilities/file.cpp
parentdd633b9dd12a8a9d7225692c49ebbe175911a6e1 (diff)
downloadserenity-a9fcdc767e7a2a37147bb14b02098e620dec47f7.zip
file: Avoid some unnecessary string copies
Diffstat (limited to 'Userland/Utilities/file.cpp')
-rw-r--r--Userland/Utilities/file.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Utilities/file.cpp b/Userland/Utilities/file.cpp
index 342724665a..0f16e50dde 100644
--- a/Userland/Utilities/file.cpp
+++ b/Userland/Utilities/file.cpp
@@ -19,7 +19,7 @@ static Optional<String> description_only(String description, [[maybe_unused]] co
}
// FIXME: Ideally Gfx::ImageDecoder could tell us the image type directly.
-static Optional<String> image_details(const String description, const String& path)
+static Optional<String> image_details(const String& description, const String& path)
{
auto file_or_error = MappedFile::map(path);
if (file_or_error.is_error())
@@ -55,7 +55,7 @@ static Optional<String> image_details(const String description, const String& pa
ENUMERATE_DESCRIPTION_CONTENTS(V)
#undef V
-static Optional<String> get_description_from_mime_type(String& mime, String path)
+static Optional<String> get_description_from_mime_type(const String& mime, const String& path)
{
#define V(var_name, mime_type, description, details) \
if (String(mime_type) == mime) \