summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibELF/DynamicLinker.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-07-01 22:29:28 -0700
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-02 10:51:20 +0430
commit179d8f6815c0246a2834fa6e61dec0b1b7e5b6ed (patch)
treef919041d40f4d0a32864793a549d00b1e56daf56 /Userland/Libraries/LibELF/DynamicLinker.cpp
parent1498dcd9e1c98b73e65dcdbbda8518286386eb31 (diff)
downloadserenity-179d8f6815c0246a2834fa6e61dec0b1b7e5b6ed.zip
LibELF: Use StringView literal to avoid string allocations
Diffstat (limited to 'Userland/Libraries/LibELF/DynamicLinker.cpp')
-rw-r--r--Userland/Libraries/LibELF/DynamicLinker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp
index 3c7482aba3..9ec4c495dd 100644
--- a/Userland/Libraries/LibELF/DynamicLinker.cpp
+++ b/Userland/Libraries/LibELF/DynamicLinker.cpp
@@ -99,7 +99,7 @@ static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> map_library(const St
static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> map_library(const String& name)
{
- if (name.contains("/")) {
+ if (name.contains("/"sv)) {
int fd = open(name.characters(), O_RDONLY);
if (fd < 0)
return DlErrorMessage { String::formatted("Could not open shared library: {}", name) };
@@ -300,13 +300,13 @@ static Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> load_main_library(co
VERIFY(!result.is_error());
auto& object = result.value();
- if (loader.filename() == "libsystem.so") {
+ if (loader.filename() == "libsystem.so"sv) {
if (syscall(SC_msyscall, object->base_address().as_ptr())) {
VERIFY_NOT_REACHED();
}
}
- if (loader.filename() == "libc.so") {
+ if (loader.filename() == "libc.so"sv) {
initialize_libc(*object);
}
}
@@ -480,7 +480,7 @@ static Result<void, DlErrorMessage> __dladdr(void* addr, Dl_info* info)
static void read_environment_variables()
{
for (char** env = s_envp; *env; ++env) {
- if (StringView { *env } == "_LOADER_BREAKPOINT=1") {
+ if (StringView { *env } == "_LOADER_BREAKPOINT=1"sv) {
s_do_breakpoint_trap_before_entry = true;
}
}