diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-05-09 10:50:04 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-05-12 18:07:36 +0300 |
commit | 870067360f8195cadf2e1953ac20a56a44377f9f (patch) | |
tree | 084b04252cbb7bfcac184d123008ea63ca33adaf /src/mbgl/programs | |
parent | baeaad83a3a3e00460b28a0afded18b8f1b83efc (diff) | |
download | qtlocation-mapboxgl-870067360f8195cadf2e1953ac20a56a44377f9f.tar.gz |
[tidy] modernize-pass-by-value
Diffstat (limited to 'src/mbgl/programs')
-rw-r--r-- | src/mbgl/programs/binary_program.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/programs/binary_program.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/programs/program_parameters.hpp | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/programs/binary_program.cpp b/src/mbgl/programs/binary_program.cpp index 3b37cfa442..09b9acc514 100644 --- a/src/mbgl/programs/binary_program.cpp +++ b/src/mbgl/programs/binary_program.cpp @@ -2,6 +2,7 @@ #include <protozero/pbf_reader.hpp> #include <protozero/pbf_writer.hpp> +#include <utility> template <class Binding> static std::pair<const std::string, Binding> parseBinding(protozero::pbf_reader&& pbf) { @@ -64,12 +65,12 @@ BinaryProgram::BinaryProgram(std::string&& data) { BinaryProgram::BinaryProgram( gl::BinaryProgramFormat binaryFormat_, std::string&& binaryCode_, - const std::string& binaryIdentifier_, + std::string binaryIdentifier_, std::vector<std::pair<const std::string, gl::AttributeLocation>>&& attributes_, std::vector<std::pair<const std::string, gl::UniformLocation>>&& uniforms_) : binaryFormat(binaryFormat_), binaryCode(std::move(binaryCode_)), - binaryIdentifier(binaryIdentifier_), + binaryIdentifier(std::move(binaryIdentifier_)), attributes(std::move(attributes_)), uniforms(std::move(uniforms_)) { } diff --git a/src/mbgl/programs/binary_program.hpp b/src/mbgl/programs/binary_program.hpp index 8ff3863dc1..b77cf1a510 100644 --- a/src/mbgl/programs/binary_program.hpp +++ b/src/mbgl/programs/binary_program.hpp @@ -14,7 +14,7 @@ public: BinaryProgram(gl::BinaryProgramFormat, std::string&& binaryCode, - const std::string& binaryIdentifier, + std::string binaryIdentifier, std::vector<std::pair<const std::string, gl::AttributeLocation>>&&, std::vector<std::pair<const std::string, gl::UniformLocation>>&&); diff --git a/src/mbgl/programs/program_parameters.hpp b/src/mbgl/programs/program_parameters.hpp index b91b41f358..e427963f81 100644 --- a/src/mbgl/programs/program_parameters.hpp +++ b/src/mbgl/programs/program_parameters.hpp @@ -1,6 +1,7 @@ #pragma once #include <string> +#include <utility> namespace mbgl { @@ -8,8 +9,8 @@ class ProgramParameters { public: ProgramParameters(float pixelRatio_ = 1.0, bool overdraw_ = false, - const std::string& cacheDir_ = "") - : pixelRatio(pixelRatio_), overdraw(overdraw_), cacheDir(cacheDir_) { + std::string cacheDir_ = "") + : pixelRatio(pixelRatio_), overdraw(overdraw_), cacheDir(std::move(cacheDir_)) { } const float pixelRatio; |