mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
LibCore+LibGfx: Pass file-path as StringView
This commit is contained in:
parent
e6a3cac5ce
commit
69aece9279
4 changed files with 8 additions and 8 deletions
|
@ -14,13 +14,13 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
ErrorOr<NonnullRefPtr<MappedFile>> MappedFile::map(String const& path)
|
||||
ErrorOr<NonnullRefPtr<MappedFile>> MappedFile::map(StringView path)
|
||||
{
|
||||
auto fd = TRY(Core::System::open(path, O_RDONLY | O_CLOEXEC, 0));
|
||||
return map_from_fd_and_close(fd, path);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<MappedFile>> MappedFile::map_from_fd_and_close(int fd, [[maybe_unused]] String const& path)
|
||||
ErrorOr<NonnullRefPtr<MappedFile>> MappedFile::map_from_fd_and_close(int fd, [[maybe_unused]] StringView path)
|
||||
{
|
||||
TRY(Core::System::fcntl(fd, F_SETFD, FD_CLOEXEC));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue