Skip to content

Commit e948bec

Browse files
anonrigtargos
authored andcommitted
src: avoid copying string in fs_permission
PR-URL: #47746 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 33d1bd3 commit e948bec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/permission/fs_permission.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void FSPermission::Apply(const std::string& allow, PermissionScope scope) {
8989
}
9090
}
9191

92-
void FSPermission::GrantAccess(PermissionScope perm, std::string res) {
92+
void FSPermission::GrantAccess(PermissionScope perm, const std::string& res) {
9393
const std::string path = WildcardIfDir(res);
9494
if (perm == PermissionScope::kFileSystemRead) {
9595
granted_in_fs_.Insert(path);

src/permission/fs_permission.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class FSPermission final : public PermissionBase {
130130
};
131131

132132
private:
133-
void GrantAccess(PermissionScope scope, std::string param);
133+
void GrantAccess(PermissionScope scope, const std::string& param);
134134
void RestrictAccess(PermissionScope scope,
135135
const std::vector<std::string>& params);
136136
// fs granted on startup

0 commit comments

Comments
 (0)