[core] More efficient layer cloning

This commit is contained in:
John Firebaugh
2015-12-04 15:19:12 -08:00
parent fc0c839fc8
commit 0a0007e0ac
11 changed files with 41 additions and 53 deletions

View File

@@ -5,10 +5,7 @@
namespace mbgl {
std::unique_ptr<StyleLayer> CircleLayer::clone() const {
std::unique_ptr<CircleLayer> result = std::make_unique<CircleLayer>();
result->copy(*this);
result->paint = paint;
return std::move(result);
return std::make_unique<CircleLayer>(*this);
}
void CircleLayer::parsePaints(const JSVal& layer) {