diff --git a/AK/DisjointChunks.h b/AK/DisjointChunks.h index 8a93f80e63..0369f6bf9b 100644 --- a/AK/DisjointChunks.h +++ b/AK/DisjointChunks.h @@ -70,7 +70,7 @@ private: ReferenceType m_chunks; }; -template +template>> class DisjointSpans { public: DisjointSpans() = default; @@ -78,7 +78,7 @@ public: DisjointSpans(DisjointSpans const&) = default; DisjointSpans(DisjointSpans&&) = default; - explicit DisjointSpans(Vector> spans) + explicit DisjointSpans(SpanContainer spans) : m_spans(move(spans)) { } @@ -185,7 +185,7 @@ private: return { m_spans.last(), index - (offset - m_spans.last().size()) }; } - Vector> m_spans; + SpanContainer m_spans; }; namespace Detail { @@ -311,13 +311,14 @@ public: return all_of(m_chunks, [](auto& chunk) { return chunk.is_empty(); }); } - DisjointSpans spans() const& + template + DisjointSpans, InlineSize>> spans() const& { - Vector> spans; + Vector, InlineSize> spans; spans.ensure_capacity(m_chunks.size()); for (auto& chunk : m_chunks) spans.unchecked_append(const_cast(chunk).span()); - return DisjointSpans { move(spans) }; + return DisjointSpans, InlineSize>> { move(spans) }; } bool operator==(DisjointChunks const& other) const