File tree 1 file changed +4
-7
lines changed
ydb/library/yql/providers/generic/connector/libcpp
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -328,18 +328,15 @@ namespace NYql::NConnector {
328
328
329
329
for (auto c : config.GetConnectors ()) {
330
330
auto cfg = ConnectorConfigToGrpcConfig (c, count++);
331
- auto f = CreateFactoryForConnector (c.GetFactory (), GrpcClient_, cfg, keepAlive);
331
+ std::shared_ptr<IConnectionFactory<NApi::Connector>> f
332
+ = std::move (CreateFactoryForConnector (c.GetFactory (), GrpcClient_, cfg, keepAlive));
332
333
333
- for (size_t i = 0 ; i < c.ForKindsSize (); ++i) {
334
- auto k = c.GetForKinds (i);
335
-
336
- if (FactoryForKind_.contains (k)) {
334
+ for (auto k : c.GetForKinds ()) {
335
+ if (!FactoryForKind_.try_emplace (NYql::EGenericDataSourceKind (k), f).second ) {
337
336
throw yexception ()
338
337
<< " Duplicate connector is provided for the kind: "
339
338
<< EGenericDataSourceKind_Name (k);
340
339
}
341
-
342
- FactoryForKind_.insert ({k, std::move (f)});
343
340
}
344
341
}
345
342
}
You can’t perform that action at this time.
0 commit comments