Skip to content

Commit 5b50322

Browse files
anonrigtargos
authored andcommitted
src: avoid copying string in fs_permission
PR-URL: #47746 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 5e99598 commit 5b50322

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)