Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b3524e9a
Commit
b3524e9a
authored
Nov 20, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix split algorithm
parent
b51bc563
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
libcaf_core/src/string_algorithms.cpp
libcaf_core/src/string_algorithms.cpp
+6
-6
No files found.
libcaf_core/src/string_algorithms.cpp
View file @
b3524e9a
...
@@ -27,15 +27,15 @@ void split_impl(F consume, string_view str, string_view delims, bool keep_all) {
...
@@ -27,15 +27,15 @@ void split_impl(F consume, string_view str, string_view delims, bool keep_all) {
size_t
pos
=
0
;
size_t
pos
=
0
;
size_t
prev
=
0
;
size_t
prev
=
0
;
while
((
pos
=
str
.
find_first_of
(
delims
,
prev
))
!=
std
::
string
::
npos
)
{
while
((
pos
=
str
.
find_first_of
(
delims
,
prev
))
!=
std
::
string
::
npos
)
{
if
(
pos
>
prev
)
{
auto
substr
=
str
.
substr
(
prev
,
pos
-
prev
);
auto
substr
=
str
.
substr
(
prev
,
pos
-
prev
);
if
(
keep_all
||
!
substr
.
empty
())
if
(
!
substr
.
empty
()
||
keep_all
)
consume
(
substr
);
consume
(
substr
);
}
prev
=
pos
+
1
;
prev
=
pos
+
1
;
}
}
if
(
prev
<
str
.
size
())
if
(
prev
<
str
.
size
())
consume
(
str
.
substr
(
prev
,
std
::
string
::
npos
));
consume
(
str
.
substr
(
prev
));
else
if
(
keep_all
)
consume
(
string_view
{});
}
}
}
// namespace <anonymous>
}
// namespace <anonymous>
...
...
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