aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-10-09 08:08:17 +0200
committerMax Kellermann <max@duempel.org>2014-10-09 08:08:17 +0200
commit990809cc2137b0de968394a0fb6ecde3bd3a0c21 (patch)
treec4d6d9c1ed5702f5afc8deb9a313947f17502e1b
parentbfcc466647bbf9566e1352c6b6257dd59a66a145 (diff)
downloadmpd-990809cc2137b0de968394a0fb6ecde3bd3a0c21.tar.gz
mpd-990809cc2137b0de968394a0fb6ecde3bd3a0c21.tar.xz
mpd-990809cc2137b0de968394a0fb6ecde3bd3a0c21.zip
lib/nfs/Connection: reduce Error instance allocations
-rw-r--r--src/lib/nfs/Connection.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index 012e4daa2..c2c7ceb2b 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -464,8 +464,7 @@ NfsConnection::MountCallback(int status, nfs_context *nfs, void *data,
inline bool
NfsConnection::MountInternal(Error &error)
{
- if (context != nullptr)
- return true;
+ assert(context == nullptr);
context = nfs_init_context();
if (context == nullptr) {
@@ -535,7 +534,7 @@ NfsConnection::BroadcastError(Error &&error)
void
NfsConnection::RunDeferred()
{
- {
+ if (context == nullptr) {
Error error;
if (!MountInternal(error)) {
BroadcastMountError(std::move(error));