mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-04 02:10:24 +00:00
log_help: Fix mem leaks
`_content` vector owns elements so that when the `ContentListing` is deleted so is the content. Remove `get_content()` method in favour of `begin()` and `end()` const iterators. More `const` in general, and iterations over `ContentListing` use `&content` to avoid copying data.
This commit is contained in:
parent
c4f685c057
commit
3e8746e78b
3 changed files with 31 additions and 36 deletions
|
@ -923,8 +923,8 @@ struct HelpPass : public Pass {
|
|||
json.name(name.c_str()); json.begin_object();
|
||||
json.entry("title", title);
|
||||
json.name("content"); json.begin_array();
|
||||
for (auto content : cmd_help.get_content())
|
||||
json.value(content->to_json());
|
||||
for (auto &content : cmd_help)
|
||||
json.value(content.to_json());
|
||||
json.end_array();
|
||||
json.entry("group", cmd_help.group);
|
||||
json.entry("source_file", pass->location.file_name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue