Expand all arrays in the queue and replace the contents of queue with them.
| 185 | |
| 186 | // Expand all arrays in the queue and replace the contents of queue with them. |
| 187 | static void ExpandArrays(JsonUdfValue* queue, JsonUdfAllocator* allocator) { |
| 188 | DCHECK(queue->IsArray()); |
| 189 | SizeType old_items = queue->Size(); |
| 190 | for (SizeType i = 0; i < old_items; ++i) { |
| 191 | if (!(*queue)[i].IsArray()) continue; |
| 192 | for (auto& v : (*queue)[i].GetArray()) queue->PushBack(v, *allocator); |
| 193 | } |
| 194 | queue->Erase(queue->Begin(), queue->Begin() + old_items); |
| 195 | } |
| 196 | |
| 197 | // Extract all values of the objects in queue and replace the contents of queue with them |
| 198 | static void ExtractValues(JsonUdfValue* queue, JsonUdfAllocator* allocator) { |
no test coverage detected