Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b8a8bdea
You need to sign in or sign up before continuing.
Commit
b8a8bdea
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Permission: use IterableSplitString
parent
8f20edac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
Permission.cxx
src/Permission.cxx
+4
-13
No files found.
src/Permission.cxx
View file @
b8a8bdea
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "config/Param.hxx"
#include "config/Param.hxx"
#include "config/Data.hxx"
#include "config/Data.hxx"
#include "config/Option.hxx"
#include "config/Option.hxx"
#include "util/IterableSplitString.hxx"
#include "util/RuntimeError.hxx"
#include "util/RuntimeError.hxx"
#include "util/StringView.hxx"
#include "util/StringView.hxx"
...
@@ -69,21 +70,11 @@ static unsigned parsePermissions(const char *string)
...
@@ -69,21 +70,11 @@ static unsigned parsePermissions(const char *string)
{
{
assert
(
string
!=
nullptr
);
assert
(
string
!=
nullptr
);
const
char
*
const
end
=
string
+
strlen
(
string
);
unsigned
permission
=
0
;
unsigned
permission
=
0
;
while
(
true
)
{
const
char
*
comma
=
std
::
find
(
string
,
end
,
PERMISSION_SEPARATOR
);
if
(
comma
>
string
)
{
permission
|=
ParsePermission
({
string
,
comma
});
}
if
(
comma
==
end
)
break
;
string
=
comma
+
1
;
for
(
const
auto
i
:
IterableSplitString
(
string
,
PERMISSION_SEPARATOR
))
}
if
(
!
i
.
empty
())
permission
|=
ParsePermission
(
i
);
return
permission
;
return
permission
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment