| 46 | // Fast path for primitives. |
| 47 | template <typename Out, typename In, typename E> |
| 48 | FOLLY_ALWAYS_INLINE bool callNullable(Out& out, const In* array, E* element) { |
| 49 | if (array == nullptr) { |
| 50 | return false; |
| 51 | } |
| 52 | out.reserve(array->size() + 1); |
| 53 | element ? out.push_back(*element) : out.add_null(); |
| 54 | out.add_items(*array); |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | // Generic implementation. |
| 59 | FOLLY_ALWAYS_INLINE bool callNullable( |