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
975e2750
Commit
975e2750
authored
Feb 08, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Charset: change FixSeparators() API to use std::string&&
parent
afcd5670
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
Charset.cxx
src/fs/Charset.cxx
+6
-11
No files found.
src/fs/Charset.cxx
View file @
975e2750
...
...
@@ -73,7 +73,8 @@ GetFSCharset()
#endif
}
static
inline
void
FixSeparators
(
std
::
string
&
s
)
static
inline
std
::
string
&&
FixSeparators
(
std
::
string
&&
s
)
{
#ifdef WIN32
// For whatever reason GCC can't convert constexpr to value reference.
...
...
@@ -81,9 +82,8 @@ static inline void FixSeparators(std::string &s)
auto
from
=
PathTraitsFS
::
SEPARATOR
;
auto
to
=
PathTraitsUTF8
::
SEPARATOR
;
std
::
replace
(
s
.
begin
(),
s
.
end
(),
from
,
to
);
#else
(
void
)
s
;
#endif
return
std
::
move
(
s
);
}
std
::
string
...
...
@@ -95,17 +95,12 @@ PathToUTF8(const char *path_fs)
#endif
#ifdef HAVE_FS_CHARSET
if
(
fs_converter
==
nullptr
)
{
if
(
fs_converter
==
nullptr
)
#endif
auto
result
=
std
::
string
(
path_fs
);
FixSeparators
(
result
);
return
result
;
return
FixSeparators
(
path_fs
);
#ifdef HAVE_FS_CHARSET
}
auto
result_path
=
fs_converter
->
ToUTF8
(
path_fs
);
FixSeparators
(
result_path
);
return
result_path
;
return
FixSeparators
(
fs_converter
->
ToUTF8
(
path_fs
));
#endif
}
...
...
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