Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Reject duplicate input names in C Predict API
Browse files Browse the repository at this point in the history
  • Loading branch information
tunalloc committed Sep 20, 2022
1 parent e2ed553 commit 26fa682
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/c_api/c_predict_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ int _CreatePartialOut(const char* symbol_json_str,
std::unordered_map<std::string, size_t> key2arg;
for (size_t i = 0; i < arg_names.size(); ++i) {
std::string key = arg_names[i];
key2arg[key] = i;
auto emplace_res = ret->key2arg.emplace(key, i);
CHECK(emplace_res.second)
<< "Input parameter name appears more than once";
}

try {
Expand Down

0 comments on commit 26fa682

Please sign in to comment.