///////////////////////////////////////////////////////////////////////////
| 135 | |
| 136 | //////////////////////////////////////////////////////////////////////////////// |
| 137 | void TF2::load_tasks() { |
| 138 | Timer timer; |
| 139 | |
| 140 | if (!_loaded_lines) { |
| 141 | load_lines(); |
| 142 | } |
| 143 | |
| 144 | // Reduce unnecessary allocations/copies. |
| 145 | // Calling it on _tasks is the right thing to do even when from_gc is set. |
| 146 | _tasks.reserve(_lines.size()); |
| 147 | |
| 148 | int line_number = 0; // Used for error message in catch block. |
| 149 | try { |
| 150 | for (auto& line : _lines) { |
| 151 | ++line_number; |
| 152 | auto task = load_task(line); |
| 153 | _tasks.push_back(task); |
| 154 | } |
| 155 | |
| 156 | _loaded_tasks = true; |
| 157 | } |
| 158 | |
| 159 | catch (const std::string& e) { |
| 160 | throw e + format(" in {1} at line {2}", _file._data, line_number); |
| 161 | } |
| 162 | |
| 163 | Context::getContext().time_load_us += timer.total_us(); |
| 164 | } |
| 165 | |
| 166 | //////////////////////////////////////////////////////////////////////////////// |
| 167 | void TF2::load_lines() { |
nothing calls this directly
no outgoing calls
no test coverage detected