diff --git a/internal/core/src/common/Types.cpp b/internal/core/src/common/Types.cpp index eea0825893..f0b2c03cb0 100644 --- a/internal/core/src/common/Types.cpp +++ b/internal/core/src/common/Types.cpp @@ -51,16 +51,3 @@ MetricTypeToName(MetricType metric_type) { } } // namespace milvus - -CProtoResult -CTestBoolArrayPb(CProto pb) { - milvus::proto::schema::BoolArray bool_array; - bool_array.ParseFromArray(pb.proto_blob, pb.proto_size); - // std::cout << pb.proto_size << std::endl; - // std::cout << bool_array.DebugString() << std::endl; - for (auto& b : *bool_array.mutable_data()) { - b = !b; - } - // create bool proto - return milvus::AllocCProtoResult(bool_array); -} diff --git a/internal/core/src/common/type_c.h b/internal/core/src/common/type_c.h index 35912a5c63..f521332b98 100644 --- a/internal/core/src/common/type_c.h +++ b/internal/core/src/common/type_c.h @@ -58,9 +58,6 @@ typedef struct CProtoResult { CProto proto; } CProtoResult; -CProtoResult -CTestBoolArrayPb(CProto pb); - #ifdef __cplusplus } #endif diff --git a/internal/querynode/cgo_helper.go b/internal/querynode/cgo_helper.go index 06384ca8b9..e06b2997fc 100644 --- a/internal/querynode/cgo_helper.go +++ b/internal/querynode/cgo_helper.go @@ -27,7 +27,6 @@ import ( "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus/internal/log" "github.com/milvus-io/milvus/internal/proto/commonpb" - "github.com/milvus-io/milvus/internal/proto/schemapb" "unsafe" ) @@ -95,14 +94,3 @@ func HandleCProtoResult(cRes *C.CProtoResult, msg proto.Message) error { defer C.free(cpro.proto_blob) return proto.Unmarshal(blob, msg) } - -// TestBoolArray this function will accept a BoolArray input, -// and return a BoolArray output -// which negates all elements of the input -func TestBoolArray(cpb *ProtoCGo) (*schemapb.BoolArray, error) { - res := C.CTestBoolArrayPb(cpb.CProto) - ba := new(schemapb.BoolArray) - err := HandleCProtoResult(&res, ba) - - return ba, err -} diff --git a/internal/querynode/cgo_helper_test.go b/internal/querynode/cgo_helper_test.go index 06c457f574..6617b88223 100644 --- a/internal/querynode/cgo_helper_test.go +++ b/internal/querynode/cgo_helper_test.go @@ -11,16 +11,6 @@ func TestCGoHelper_Naive(t *testing.T) { pb := schemapb.BoolArray{ Data: []bool{true, false, true, true, true}, } - cpb, err := MarshalForCGo(&pb) + _, err := MarshalForCGo(&pb) assert.Nil(t, err) - - // this function will accept a BoolArray input, - // and return a BoolArray output - // which negates all elements of the input - ba, err := TestBoolArray(cpb) - - assert.Nil(t, err) - for index, b := range ba.Data { - assert.Equal(t, b, !pb.Data[index]) - } }