| 319 | |
| 320 | |
| 321 | const Value* Path::Element::getFromArray(const Value* item, int32_t index) noexcept { |
| 322 | auto a = item->asArray(); |
| 323 | if (_usuallyFalse(!a)) |
| 324 | return nullptr; |
| 325 | if (index < 0) { |
| 326 | uint32_t count = a->count(); |
| 327 | if (_usuallyFalse((uint32_t)-index > count)) |
| 328 | return nullptr; |
| 329 | index += count; |
| 330 | } |
| 331 | return a->get((uint32_t)index); |
| 332 | } |
| 333 | |
| 334 | } } |