| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) | ||
| 3 | // | ||
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
| 6 | // | ||
| 7 | // Official repository: https://github.com/boostorg/json | ||
| 8 | // | ||
| 9 | |||
| 10 | #ifndef BOOST_JSON_DETAIL_IMPL_ARRAY_HPP | ||
| 11 | #define BOOST_JSON_DETAIL_IMPL_ARRAY_HPP | ||
| 12 | |||
| 13 | namespace boost { | ||
| 14 | namespace json { | ||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | 2120 | unchecked_array:: | |
| 18 | 854 | ~unchecked_array() | |
| 19 | { | ||
| 20 |
6/6✓ Branch 0 taken 857 times.
✓ Branch 1 taken 1263 times.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 854 times.
✓ Branch 4 taken 1266 times.
✓ Branch 5 taken 854 times.
|
2977 | if(! data_ || |
| 21 | 857 | sp_.is_not_shared_and_deallocate_is_trivial()) | |
| 22 | 1266 | return; | |
| 23 | 919 | for(unsigned long i = 0; | |
| 24 |
2/2✓ Branch 0 taken 65 times.
✓ Branch 1 taken 854 times.
|
919 | i < size_; ++i) |
| 25 | 65 | data_[i].~value(); | |
| 26 | 2120 | } | |
| 27 | |||
| 28 | void | ||
| 29 | 1263 | unchecked_array:: | |
| 30 | relocate(value* dest) noexcept | ||
| 31 | { | ||
| 32 |
1/2✓ Branch 0 taken 1263 times.
✗ Branch 1 not taken.
|
1263 | if(size_ > 0) |
| 33 | 1263 | std::memcpy( | |
| 34 | static_cast<void*>(dest), | ||
| 35 | 1263 | data_, size_ * sizeof(value)); | |
| 36 | 1263 | data_ = nullptr; | |
| 37 | 1263 | } | |
| 38 | |||
| 39 | } // detail | ||
| 40 | } // namespace json | ||
| 41 | } // namespace boost | ||
| 42 | |||
| 43 | #endif | ||
| 44 |