summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-20 12:38:09 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-23 12:09:09 +0200
commitd15b9c1f9c1afa29175ba2e398adc680e66147e6 (patch)
tree6bf426ae77d7386a6bbdee30444974bbc5dd76d0 /platform/glfw
parent37802eec36aae3cb84c7f73a48652d9959489243 (diff)
downloadqtlocation-mapboxgl-d15b9c1f9c1afa29175ba2e398adc680e66147e6.tar.gz
[core] Fix performance-unnecessary-value-param errors
As reported by clang-tidy-8.
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_view.cpp11
-rw-r--r--platform/glfw/main.cpp2
2 files changed, 7 insertions, 6 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index d6c85e3068..6993de6f66 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -39,6 +39,7 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
+#include <utility>
class SnapshotObserver final : public mbgl::MapSnapshotterObserver {
public:
@@ -640,11 +641,11 @@ void GLFWView::makeSnapshot(bool withOverlay) {
auto snapshot = [&] {
snapshotter->setCameraOptions(map->getCameraOptions());
- snapshotter->snapshot([](std::exception_ptr ptr,
+ snapshotter->snapshot([](const std::exception_ptr &ptr,
mbgl::PremultipliedImage image,
- mbgl::MapSnapshotter::Attributions,
- mbgl::MapSnapshotter::PointForFn,
- mbgl::MapSnapshotter::LatLngForFn) {
+ const mbgl::MapSnapshotter::Attributions &,
+ const mbgl::MapSnapshotter::PointForFn &,
+ const mbgl::MapSnapshotter::LatLngForFn &) {
if (!ptr) {
mbgl::Log::Info(mbgl::Event::General,
"Made snapshot './snapshot.png' with size w:%dpx h:%dpx",
@@ -865,7 +866,7 @@ void GLFWView::report(float duration) {
}
void GLFWView::setChangeStyleCallback(std::function<void()> callback) {
- changeStyleCallback = callback;
+ changeStyleCallback = std::move(callback);
}
void GLFWView::setShouldClose() {
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp
index fa1ac73799..3b45c4482f 100644
--- a/platform/glfw/main.cpp
+++ b/platform/glfw/main.cpp
@@ -183,7 +183,7 @@ int main(int argc, char *argv[]) {
auto databaseFileSource = std::static_pointer_cast<mbgl::DatabaseFileSource>(std::shared_ptr<mbgl::FileSource>(
mbgl::FileSourceManager::get()->getFileSource(mbgl::FileSourceType::Database, resourceOptions)));
view->setResetCacheCallback([databaseFileSource]() {
- databaseFileSource->resetDatabase([](std::exception_ptr ex) {
+ databaseFileSource->resetDatabase([](const std::exception_ptr& ex) {
if (ex) {
mbgl::Log::Error(mbgl::Event::Database, "Failed to reset cache:: %s", mbgl::util::toString(ex).c_str());
}