Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e948bec

Browse filesBrowse 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
Copy full SHA for e948bec

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎src/permission/fs_permission.cc‎

Copy file name to clipboardExpand all lines: src/permission/fs_permission.cc
+1-1Lines changed: 1 addition & 1 deletion
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);
Collapse file

‎src/permission/fs_permission.h‎

Copy file name to clipboardExpand all lines: src/permission/fs_permission.h
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.