File Coverage

src/panda/error.cc
Criterion Covered Total %
statement 8 8 100.0
branch 6 8 75.0
condition n/a
subroutine n/a
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             #include "error.h"
2              
3             namespace panda { namespace error {
4              
5 15           const NestedCategory& get_nested_categoty(const std::error_category& self, const NestedCategory* next) {
6 15 100         static thread_local std::map, NestedCategory> cache;
7 15 50         auto iter = cache.find({&self, next});
8 15 100         if (iter != cache.end()) {
9 11           return iter->second;
10             } else {
11 4 50         return cache.emplace(std::piecewise_construct,
12 4           std::forward_as_tuple(&self, next),
13 19           std::forward_as_tuple(self, next)).first->second;
14             }
15             }
16              
17             }}