| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "../include/ops_seq.hpp" | ||
| 2 | |||
| 3 | #include "../../common/include/common.hpp" | ||
| 4 | |||
| 5 | namespace shekhirev_v_char_freq_seq { | ||
| 6 | |||
| 7 |
1/2✓ Branch 1 taken 50 times.
✗ Branch 2 not taken.
|
50 | CharFreqSequential::CharFreqSequential(const InType &in) { |
| 8 | SetTypeOfTask(GetStaticTypeOfTask()); | ||
| 9 | GetInput() = in; | ||
| 10 | 50 | GetOutput() = 0; | |
| 11 | 50 | } | |
| 12 | |||
| 13 | 50 | bool CharFreqSequential::ValidationImpl() { | |
| 14 | 50 | return true; | |
| 15 | } | ||
| 16 | |||
| 17 | 50 | bool CharFreqSequential::PreProcessingImpl() { | |
| 18 | 50 | return true; | |
| 19 | } | ||
| 20 | |||
| 21 | 50 | bool CharFreqSequential::RunImpl() { | |
| 22 | const auto &str = GetInput().str; | ||
| 23 | 50 | char target = GetInput().target; | |
| 24 | |||
| 25 | int count = 0; | ||
| 26 |
2/2✓ Branch 0 taken 410 times.
✓ Branch 1 taken 50 times.
|
460 | for (char c : str) { |
| 27 |
2/2✓ Branch 0 taken 154 times.
✓ Branch 1 taken 256 times.
|
410 | if (c == target) { |
| 28 | 154 | count++; | |
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | 50 | GetOutput() = count; | |
| 33 | 50 | return true; | |
| 34 | } | ||
| 35 | |||
| 36 | 50 | bool CharFreqSequential::PostProcessingImpl() { | |
| 37 | 50 | return true; | |
| 38 | } | ||
| 39 | |||
| 40 | } // namespace shekhirev_v_char_freq_seq | ||
| 41 |