aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-28 18:25:51 +0200
committerMax Kellermann <max@duempel.org>2014-09-28 18:25:51 +0200
commit540317ea2ba6a36f041364fb68ec6b8b43395d98 (patch)
treef8c24d6194e04ea540bd1d9c892f28a3324b1f9b
parent142d1951d25329c4ca6881d04e2f4ab82d05ac11 (diff)
downloadmpd-540317ea2ba6a36f041364fb68ec6b8b43395d98.tar.gz
mpd-540317ea2ba6a36f041364fb68ec6b8b43395d98.tar.xz
mpd-540317ea2ba6a36f041364fb68ec6b8b43395d98.zip
storage/nfs: use string::append() instead of string::insert()
Swap the order of adding the URI and the slash, because appending is cheaper than inserting.
Diffstat (limited to '')
-rw-r--r--src/storage/plugins/NfsStorage.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index e8ac23ec0..2c331dde6 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -82,10 +82,9 @@ public:
static std::string
UriToNfsPath(const char *uri_utf8)
{
- std::string path(uri_utf8);
-
/* libnfs paths must begin with a slash */
- path.insert(path.begin(), '/');
+ std::string path("/");
+ path.append(uri_utf8);
return path;
}