lib/nfs/Connection: reduce Error instance allocations
This commit is contained in:
@@ -464,8 +464,7 @@ NfsConnection::MountCallback(int status, nfs_context *nfs, void *data,
|
|||||||
inline bool
|
inline bool
|
||||||
NfsConnection::MountInternal(Error &error)
|
NfsConnection::MountInternal(Error &error)
|
||||||
{
|
{
|
||||||
if (context != nullptr)
|
assert(context == nullptr);
|
||||||
return true;
|
|
||||||
|
|
||||||
context = nfs_init_context();
|
context = nfs_init_context();
|
||||||
if (context == nullptr) {
|
if (context == nullptr) {
|
||||||
@@ -535,7 +534,7 @@ NfsConnection::BroadcastError(Error &&error)
|
|||||||
void
|
void
|
||||||
NfsConnection::RunDeferred()
|
NfsConnection::RunDeferred()
|
||||||
{
|
{
|
||||||
{
|
if (context == nullptr) {
|
||||||
Error error;
|
Error error;
|
||||||
if (!MountInternal(error)) {
|
if (!MountInternal(error)) {
|
||||||
BroadcastMountError(std::move(error));
|
BroadcastMountError(std::move(error));
|
||||||
|
Reference in New Issue
Block a user