Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 658fdc7d authored by Ryan Prichard's avatar Ryan Prichard
Browse files

libcompositionengine: avoid vector<const T>

A container of const T uses std::allocator<const T>, which was an
undocumented libc++ extension that has been removed.

See https://github.com/llvm/llvm-project/pull/96319.

Bug: 349681543
Test: m libcompositionengine
Change-Id: I359350a298fc9a59c0ca925a36f753ac3fb3b64e
parent 40800e1b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -92,15 +92,15 @@ public:
    }

private:
    std::vector<const LayerState> copyLayers(const std::vector<const LayerState*>& layers) {
        std::vector<const LayerState> copiedLayers;
    std::vector<LayerState> copyLayers(const std::vector<const LayerState*>& layers) {
        std::vector<LayerState> copiedLayers;
        copiedLayers.reserve(layers.size());
        std::transform(layers.cbegin(), layers.cend(), std::back_inserter(copiedLayers),
                       [](const LayerState* layerState) { return *layerState; });
        return copiedLayers;
    }

    std::vector<const LayerState> mLayers;
    std::vector<LayerState> mLayers;

    // TODO(b/180976743): Tune kMaxDifferingFields
    constexpr static int kMaxDifferingFields = 6;