Browse Source

fix: status check in static fetch function

legacy
Dnomd343 2 years ago
parent
commit
ef7878390d
  1. 2
      src/all_cases/all_cases.cc
  2. 2
      src/all_cases/basic_ranges.cc

2
src/all_cases/all_cases.cc

@ -17,7 +17,7 @@ AllCases::Status AllCases::status() { // get all cases status
} }
const std::vector<uint32_t> (*AllCases::fetch())[16] { // get const ptr of all cases const std::vector<uint32_t> (*AllCases::fetch())[16] { // get const ptr of all cases
if (all_cases->empty()) { if (status() != AllCases::AVAILABLE) {
AllCases::build(); // all cases initialize AllCases::build(); // all cases initialize
} }
return &all_cases; // return ptr return &all_cases; // return ptr

2
src/all_cases/basic_ranges.cc

@ -27,7 +27,7 @@ BasicRanges::Status BasicRanges::status() { // get basic ranges status
} }
const std::vector<uint32_t>* BasicRanges::fetch() { // get const ptr of basic ranges const std::vector<uint32_t>* BasicRanges::fetch() { // get const ptr of basic ranges
if (basic_ranges.empty()) { if (status() != BasicRanges::AVAILABLE) {
BasicRanges::build(); // basic ranges initialize BasicRanges::build(); // basic ranges initialize
} }
return &basic_ranges; // return ptr return &basic_ranges; // return ptr

Loading…
Cancel
Save