diff --git a/core/src/server/grpc_impl/GrpcRequestHandler.cpp b/core/src/server/grpc_impl/GrpcRequestHandler.cpp index 1d375a186b..a4ec05e8f9 100644 --- a/core/src/server/grpc_impl/GrpcRequestHandler.cpp +++ b/core/src/server/grpc_impl/GrpcRequestHandler.cpp @@ -521,9 +521,7 @@ GrpcRequestHandler::SearchInFiles(::grpc::ServerContext* context, const ::milvus // step 2: copy file id array std::vector file_ids; - for (auto& file_id : request->file_id_array()) { - file_ids.emplace_back(file_id); - } + std::copy(request->file_id_array().begin(), request->file_id_array().end(), std::back_inserter(file_ids)); // step 3: partition tags std::vector partitions;