+ : LAGER_QT(count)(model.map([](const Model &m) {
+ return m.a.size() + m.b.size(); // O(1) time!
+ }))
+ {}
+
+ auto QmlWrapper::at(int i) -> QmlItem *
+ {
+ return new QmlItem(LAGER_QT(combined).map([i](const immer::flex_vector<Item> &c) {
+ return i >= m.a.size() + m.b.size()
+ ? Item{}
+ : i >= m.a.size()
+ ? m.b[i - m.a.size()]
+ : m.a[i];
+ }));
+ }
+ #+END_SRC
* Using src_c++{lager::state} (leave to Dmitry)
* Appendix
** Calculating libQuotient coverage adjusted
libQuotient includes the generated csapi folder into coverage, while libkazv does not. Here is the code that calculates the coverage of libQuotient excluding the csapi folder.
#+NAME: libquotient-coverage
#+BEGIN_SRC perl
my $csapiCoverage = 0.169;
my $csapiUncovered = 1_668;
my $totalLines = 11_229;
my $totalUncovered = 6_561;
my $csapiLines = $csapiUncovered / (1-$csapiCoverage);
my $remainingLines = $totalLines - $csapiLines;
my $remainingUncovered = $totalUncovered - $csapiUncovered;
my $remainingCoverage = 1 - $remainingUncovered / $remainingLines;