From 8741fa1d4555aaf17b08fd478a2bd2fb798756f0 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 1 Aug 2019 19:20:03 +0300 Subject: Use butl::small_vector instead of std::vector in persistent classes where it makes sense --- bpkg/odb.sh | 2 ++ bpkg/package.hxx | 4 ++-- bpkg/rep-remove.cxx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bpkg/odb.sh b/bpkg/odb.sh index 72753fa..0c8ae1b 100755 --- a/bpkg/odb.sh +++ b/bpkg/odb.sh @@ -43,7 +43,9 @@ fi $odb "${inc[@]}" \ -DLIBODB_BUILD2 -DLIBODB_SQLITE_BUILD2 --generate-schema \ -d sqlite --std c++14 --generate-query \ + --odb-epilogue '#include ' \ --odb-epilogue '#include ' \ + --hxx-prologue '#include ' \ --hxx-prologue '#include ' \ --hxx-prologue '#include ' \ --include-with-brackets --include-prefix bpkg --guard-prefix BPKG \ diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 9d7cedf..3ac48a6 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -346,7 +346,7 @@ namespace bpkg lazy_shared_ptr fragment; }; - using fragments_type = std::vector; + using fragments_type = small_vector; string name; // Object id (canonical name). repository_location location; @@ -459,7 +459,7 @@ namespace bpkg // that since the package is already in at least fetched state, we // shouldn't be needing its location. // - vector locations; + small_vector locations; // Package manifest data. // diff --git a/bpkg/rep-remove.cxx b/bpkg/rep-remove.cxx index 60923fa..96e96db 100644 --- a/bpkg/rep-remove.cxx +++ b/bpkg/rep-remove.cxx @@ -109,7 +109,7 @@ namespace bpkg query::repository_fragment::name == fragment_name)) { const shared_ptr& p (rp); - vector& ls (p->locations); + small_vector& ls (p->locations); for (auto i (ls.cbegin ()); i != ls.cend (); ++i) { -- cgit v1.1