Skip to content

Commit

Permalink
ofPixels.h/cpp remove move on return to allow copy ellision (#6407)
Browse files Browse the repository at this point in the history
#changelog #graphics
  • Loading branch information
oxillo authored and arturoc committed Oct 24, 2019
1 parent 6079447 commit 951d1e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/openFrameworks/graphics/ofPixels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ ofPixels_<PixelType> ofPixels_<PixelType>::getPlane(size_t planeIdx){
case OF_PIXELS_UNKNOWN:
break;
}
return std::move(plane);
return plane;
}

template<typename PixelType>
Expand Down Expand Up @@ -1009,7 +1009,7 @@ ofPixels_<PixelType> ofPixels_<PixelType>::getChannel(size_t channel) const{
for(auto p: getConstPixelsIter()){
*channelPixel++ = p[channel];
}
return std::move(channelPixels);
return channelPixels;
}

template<typename PixelType>
Expand Down
4 changes: 2 additions & 2 deletions libs/openFrameworks/graphics/ofPixels.h
Original file line number Diff line number Diff line change
Expand Up @@ -1093,15 +1093,15 @@ template<typename PixelType>
inline ofPixels_<PixelType> ofPixels_<PixelType>::Line::asPixels(){
ofPixels_<PixelType> pixels;
pixels.setFromExternalPixels(_begin,stride/componentsPerPixel,1,pixelFormat);
return std::move(pixels);
return pixels;
}

//----------------------------------------------------------------------
template<typename PixelType>
inline const ofPixels_<PixelType> ofPixels_<PixelType>::Line::asPixels() const{
ofPixels_<PixelType> pixels;
pixels.setFromExternalPixels(_begin,stride/componentsPerPixel,1,pixelFormat);
return std::move(pixels);
return pixels;
}

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

0 comments on commit 951d1e0

Please sign in to comment.