| 375 | } |
| 376 | |
| 377 | VectorPtr readConstantVector( |
| 378 | const TypePtr& type, |
| 379 | vector_size_t size, |
| 380 | std::istream& in, |
| 381 | memory::MemoryPool* pool) { |
| 382 | // Is-null flag. |
| 383 | auto isNull = read<bool>(in); |
| 384 | |
| 385 | if (isNull) { |
| 386 | return BaseVector::createNullConstant(type, size, pool); |
| 387 | } |
| 388 | |
| 389 | bool scalar = read<bool>(in); |
| 390 | if (scalar) { |
| 391 | return BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL( |
| 392 | readConstant, type->kind(), type, size, pool, in); |
| 393 | } |
| 394 | |
| 395 | auto baseVector = restoreVector(in, pool); |
| 396 | auto baseIndex = read<int32_t>(in); |
| 397 | |
| 398 | return BaseVector::wrapInConstant(size, baseIndex, baseVector); |
| 399 | } |
| 400 | |
| 401 | void writeDictionaryVector(const BaseVector& vector, std::ostream& out) { |
| 402 | // Nulls buffer. |
no test coverage detected