From f91ed91688739245a99a0ac6b78c90a6d2faf90a Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 28 Feb 2020 12:10:27 +0800 Subject: [PATCH] Remove unnecessary std::move semantics --- cocos/renderer/backend/opengl/ProgramGL.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cocos/renderer/backend/opengl/ProgramGL.cpp b/cocos/renderer/backend/opengl/ProgramGL.cpp index 840c09f2fd..206bd51a58 100644 --- a/cocos/renderer/backend/opengl/ProgramGL.cpp +++ b/cocos/renderer/backend/opengl/ProgramGL.cpp @@ -43,8 +43,8 @@ ProgramGL::ProgramGL(const std::string& vertexShader, const std::string& fragmen { #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID // some device required manually specify the precision qualifiers for vertex shader. - _vertexShaderModule = static_cast(ShaderCache::newVertexShaderModule(std::move(SHADER_PREDEFINE + _vertexShader))); - _fragmentShaderModule = static_cast(ShaderCache::newFragmentShaderModule(std::move(SHADER_PREDEFINE + _fragmentShader))); + _vertexShaderModule = static_cast(ShaderCache::newVertexShaderModule(SHADER_PREDEFINE + _vertexShader)); + _fragmentShaderModule = static_cast(ShaderCache::newFragmentShaderModule(SHADER_PREDEFINE + _fragmentShader)); #else _vertexShaderModule = static_cast(ShaderCache::newVertexShaderModule(_vertexShader)); _fragmentShaderModule = static_cast(ShaderCache::newFragmentShaderModule(_fragmentShader)); @@ -89,8 +89,8 @@ void ProgramGL::reloadProgram() _activeUniformInfos.clear(); _mapToCurrentActiveLocation.clear(); _mapToOriginalLocation.clear(); - static_cast(_vertexShaderModule)->compileShader(backend::ShaderStage::VERTEX, std::move(SHADER_PREDEFINE + _vertexShader)); - static_cast(_fragmentShaderModule)->compileShader(backend::ShaderStage::FRAGMENT, std::move(SHADER_PREDEFINE + _fragmentShader)); + static_cast(_vertexShaderModule)->compileShader(backend::ShaderStage::VERTEX, SHADER_PREDEFINE + _vertexShader); + static_cast(_fragmentShaderModule)->compileShader(backend::ShaderStage::FRAGMENT, SHADER_PREDEFINE + _fragmentShader); compileProgram(); computeUniformInfos(); @@ -341,7 +341,8 @@ int ProgramGL::getOriginalLocation(int location) const const UniformInfo& ProgramGL::getActiveUniformInfo(ShaderStage stage, int location) const { - return std::move(UniformInfo{}); + static const UniformInfo s_emptyInfo{}; + return s_emptyInfo; } const std::unordered_map& ProgramGL::getAllActiveUniformInfo(ShaderStage stage) const