mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
Improve segcore code readability (#7868)
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
a589572e2d
commit
4dc9a64f01
@ -27,8 +27,7 @@ struct InsertRecord {
|
||||
explicit InsertRecord(const Schema& schema, int64_t size_per_chunk);
|
||||
|
||||
// get field data without knowing the type
|
||||
// return VectorBase type
|
||||
auto
|
||||
VectorBase*
|
||||
get_field_data_base(FieldOffset field_offset) const {
|
||||
auto ptr = field_datas_[field_offset.get()].get();
|
||||
return ptr;
|
||||
@ -36,7 +35,7 @@ struct InsertRecord {
|
||||
|
||||
// get field data in given type, const version
|
||||
template <typename Type>
|
||||
auto
|
||||
const ConcurrentVector<Type>*
|
||||
get_field_data(FieldOffset field_offset) const {
|
||||
auto base_ptr = get_field_data_base(field_offset);
|
||||
auto ptr = dynamic_cast<const ConcurrentVector<Type>*>(base_ptr);
|
||||
@ -44,9 +43,9 @@ struct InsertRecord {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
// get field data in given type, nonconst version
|
||||
// get field data in given type, non-const version
|
||||
template <typename Type>
|
||||
auto
|
||||
ConcurrentVector<Type>*
|
||||
get_field_data(FieldOffset field_offset) {
|
||||
auto base_ptr = get_field_data_base(field_offset);
|
||||
auto ptr = dynamic_cast<ConcurrentVector<Type>*>(base_ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user