[core] Fix performance-unnecessary-value-param errors in header files
As reported by clang-tidy-8.
This commit is contained in:
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
// Style is missing an image
|
||||
using StyleImageMissingCallback = std::function<void()>;
|
||||
virtual void onStyleImageMissing(const std::string&, StyleImageMissingCallback done) { done(); }
|
||||
virtual void onStyleImageMissing(const std::string&, const StyleImageMissingCallback& done) { done(); }
|
||||
virtual void onRemoveUnusedStyleImages(const std::vector<std::string>&) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
// Allows to forward response from one source to another.
|
||||
// Optionally, callback can be provided to receive notification for forward
|
||||
// operation.
|
||||
//
|
||||
// NOLINTNEXTLINE(performance-unnecessary-value-param)
|
||||
virtual void forward(const Resource&, const Response&, std::function<void()>) {}
|
||||
|
||||
// When a file source supports consulting a local cache only, it must return true.
|
||||
@@ -82,7 +84,7 @@ public:
|
||||
virtual mapbox::base::Value getProperty(const std::string&) const { return {}; };
|
||||
|
||||
// When supported, sets the modifier of the requested resources.
|
||||
virtual void setResourceTransform(ResourceTransform) {}
|
||||
virtual void setResourceTransform(ResourceTransform) {} // NOLINT(performance-unnecessary-value-param)
|
||||
|
||||
protected:
|
||||
FileSource() = default;
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
* responsibility of the SDK bindings to wrap this object in an interface that
|
||||
* re-executes the user-provided implementation on the main thread.
|
||||
*/
|
||||
virtual void responseError(Response::Error) {}
|
||||
virtual void responseError(Response::Error) {} // NOLINT(performance-unnecessary-value-param)
|
||||
|
||||
/*
|
||||
* Implement this method to be notified when the limit on the number of Mapbox
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
delegate.invoke(&RendererObserver::onDidFinishRenderingFrame, mode, repaintNeeded, placementChanged);
|
||||
}
|
||||
|
||||
void onStyleImageMissing(const std::string& image, StyleImageMissingCallback cb) override {
|
||||
delegate.invoke(&RendererObserver::onStyleImageMissing, image, std::move(cb));
|
||||
void onStyleImageMissing(const std::string& image, const StyleImageMissingCallback& cb) override {
|
||||
delegate.invoke(&RendererObserver::onStyleImageMissing, image, cb);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
rendererObserver->onDidFinishRenderingFrame(mode, repaintNeeded, placementChanged);
|
||||
}
|
||||
|
||||
void onStyleImageMissing(const std::string& id, StyleImageMissingCallback done) override {
|
||||
void onStyleImageMissing(const std::string& id, const StyleImageMissingCallback& done) override {
|
||||
rendererObserver->onStyleImageMissing(id, done);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ void Map::Impl::jumpTo(const CameraOptions& camera) {
|
||||
onUpdate();
|
||||
}
|
||||
|
||||
void Map::Impl::onStyleImageMissing(const std::string& id, std::function<void()> done) {
|
||||
void Map::Impl::onStyleImageMissing(const std::string& id, const std::function<void()>& done) {
|
||||
if (!style->getImage(id)) observer.onStyleImageMissing(id);
|
||||
|
||||
done();
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
void onDidFinishRenderingFrame(RenderMode, bool, bool) final;
|
||||
void onWillStartRenderingMap() final;
|
||||
void onDidFinishRenderingMap() final;
|
||||
void onStyleImageMissing(const std::string&, std::function<void()>) final;
|
||||
void onStyleImageMissing(const std::string&, const std::function<void()>&) final;
|
||||
void onRemoveUnusedStyleImages(const std::vector<std::string>&) final;
|
||||
|
||||
// Map
|
||||
|
||||
@@ -8,7 +8,7 @@ class ImageManagerObserver {
|
||||
public:
|
||||
virtual ~ImageManagerObserver() = default;
|
||||
|
||||
virtual void onStyleImageMissing(const std::string&, std::function<void()> done) { done(); }
|
||||
virtual void onStyleImageMissing(const std::string&, const std::function<void()>& done) { done(); }
|
||||
virtual void onRemoveUnusedStyleImages(const std::vector<std::string>&) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -727,8 +727,8 @@ void RenderOrchestrator::onTileChanged(RenderSource&, const OverscaledTileID&) {
|
||||
observer->onInvalidate();
|
||||
}
|
||||
|
||||
void RenderOrchestrator::onStyleImageMissing(const std::string& id, std::function<void()> done) {
|
||||
observer->onStyleImageMissing(id, std::move(done));
|
||||
void RenderOrchestrator::onStyleImageMissing(const std::string& id, const std::function<void()>& done) {
|
||||
observer->onStyleImageMissing(id, done);
|
||||
}
|
||||
|
||||
void RenderOrchestrator::onRemoveUnusedStyleImages(const std::vector<std::string>& unusedImageIDs) {
|
||||
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
void onTileError(RenderSource&, const OverscaledTileID&, std::exception_ptr) override;
|
||||
|
||||
// ImageManagerObserver implementation
|
||||
void onStyleImageMissing(const std::string&, std::function<void()>) override;
|
||||
void onStyleImageMissing(const std::string&, const std::function<void()>&) override;
|
||||
void onRemoveUnusedStyleImages(const std::vector<std::string>&) override;
|
||||
|
||||
RendererObserver* observer;
|
||||
|
||||
@@ -15,7 +15,10 @@ class Image;
|
||||
class SpriteLoaderObserver {
|
||||
public:
|
||||
virtual ~SpriteLoaderObserver() = default;
|
||||
|
||||
// NOLINTNEXTLINE(performance-unnecessary-value-param)
|
||||
virtual void onSpriteLoaded(std::vector<Immutable<style::Image::Impl>>) {}
|
||||
|
||||
virtual void onSpriteError(std::exception_ptr) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class StubImageManagerObserver : public ImageManagerObserver {
|
||||
public:
|
||||
int count = 0;
|
||||
std::function<void (const std::string&)> imageMissing = [](const std::string&){};
|
||||
void onStyleImageMissing(const std::string& id, std::function<void()> done) override {
|
||||
void onStyleImageMissing(const std::string& id, const std::function<void()>& done) override {
|
||||
count++;
|
||||
imageMissing(id);
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user