diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-09-04 14:05:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-09-04 14:05:35 +0000 |
commit | 601af030f40b9b7d270e59fbff68dbf32583fef4 (patch) | |
tree | 6763c964e4359b284697875961b9a2cd3b6e96cd | |
parent | 5f9ef04076bb9ee0e9866380ee5af1a85b21509b (diff) |
Better naming
-rw-r--r-- | eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp | 18 | ||||
-rw-r--r-- | storage/src/vespa/storage/distributor/activecopy.cpp | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp b/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp index 864bc7d095d..03db333d582 100644 --- a/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp +++ b/eval/src/apps/analyze_onnx_model/analyze_onnx_model.cpp @@ -68,10 +68,10 @@ size_t convert(const vespalib::string & s) { if (ec != std::errc()) { throw std::runtime_error(fmt("Bad format : '%s' at '%s'", s.c_str(), ptr)); } - if (end != vespalib::string::npos) { - return v * 1024; + if (end == vespalib::string::npos) { + throw std::runtime_error(fmt("Bad format : %s", s.c_str())); } - throw std::runtime_error(fmt("Bad format : %s", s.c_str())); + return v * 1024; } MemoryUsage extract_memory_usage() { @@ -266,17 +266,17 @@ int probe_types() { auto &types = root.setObject("outputs"); Onnx model(params["model"].asString().make_string(), Onnx::Optimize::ENABLE); Onnx::WirePlanner planner; - for (const auto & i : model.inputs()) { - auto spec = params["inputs"][i.name].asString().make_string(); + for (const auto & input : model.inputs()) { + auto spec = params["inputs"][input.name].asString().make_string(); auto input_type = ValueType::from_spec(spec); if (input_type.is_error()) { - if (!params["inputs"][i.name].valid()) { - throw MyError(fmt("missing type for model input '%s'", i.name.c_str())); + if (!params["inputs"][input.name].valid()) { + throw MyError(fmt("missing type for model input '%s'", input.name.c_str())); } else { - throw MyError(fmt("invalid type for model input '%s': '%s'",i.name.c_str(), spec.c_str())); + throw MyError(fmt("invalid type for model input '%s': '%s'",input.name.c_str(), spec.c_str())); } } - bind_input(planner, i, input_type); + bind_input(planner, input, input_type); } planner.prepare_output_types(model); for (const auto &output: model.outputs()) { diff --git a/storage/src/vespa/storage/distributor/activecopy.cpp b/storage/src/vespa/storage/distributor/activecopy.cpp index 4659142ddb5..e9d6d8cca30 100644 --- a/storage/src/vespa/storage/distributor/activecopy.cpp +++ b/storage/src/vespa/storage/distributor/activecopy.cpp @@ -170,8 +170,8 @@ ActiveList::print(std::ostream& out, bool verbose, const std::string& indent) co { out << "["; if (verbose) { - for (auto i : _v) { - out << "\n" << indent << " " << i.nodeIndex() << " " << i.getReason(); + for (const auto & copy : _v) { + out << "\n" << indent << " " << copy.nodeIndex() << " " << copy.getReason(); } if (!_v.empty()) { out << "\n" << indent; |