Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XrdEc] Fix build errors due to -Werror=pessimizing-move #1828

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/XrdEc/XrdEcStrmWriter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ namespace XrdEc
{
std::future<WrtBuff*> ftr = buffers.dequeue();
std::unique_ptr<WrtBuff> result( ftr.get() );
return std::move( result );
return result;
}

//-----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/XrdEc/XrdEcThreadPool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace XrdEc
AnyJob<FUNC, RET, ARGs...> *job = new AnyJob<FUNC, RET, ARGs...>( func, std::move( args )... );
std::future<RET> ftr = job->GetFuture();
threadpool.QueueJob( job, nullptr );
return std::move( ftr );
return ftr;
}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/XrdEc/XrdEcUtilities.hh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ namespace XrdEc
}
Element element = std::move( elements.front() );
elements.pop();
return std::move( element );
return element;
}

//-------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/XrdEc/XrdEcWrtBuff.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace XrdEc
{
XrdCl::Buffer buffer( std::move( pool.front() ) );
pool.pop();
return std::move( buffer );
return buffer;
}
//---------------------------------------------------------------------
// Check if we can create a new buffer object without exceeding the
Expand All @@ -81,15 +81,15 @@ namespace XrdEc
{
XrdCl::Buffer buffer( objcfg.blksize );
++currentsize;
return std::move( buffer );
return buffer;
}
//---------------------------------------------------------------------
// If not, we have to wait until there is a buffer we can recycle
//---------------------------------------------------------------------
while( pool.empty() ) cv.wait( lck );
XrdCl::Buffer buffer( std::move( pool.front() ) );
pool.pop();
return std::move( buffer );
return buffer;
}

//-----------------------------------------------------------------------
Expand Down