Opened on 04/05/21 at 18:29:36
Closed on 12/22/21 at 14:35:57
#4376 closed defect (fixed)
covoar/ReportsBase Coverage::GenerateReports() uses raw pointer to std::list
Reported by: | Alex White | Owned by: | Ryan Long <ryan.long@…> |
---|---|---|---|
Priority: | normal | Milestone: | 6.1 |
Component: | tool | Version: | 6 |
Severity: | normal | Keywords: | coverage, covoar |
Cc: | Blocked By: | ||
Blocking: |
Description (last modified by Joel Sherrill)
The Coverage::GenerateReports()
function uses a variable of type std::list<ReportsBase *>
to store the ReportsBase
-derived classes used to generate the reports. The function should use an std::vector<std::unique_ptr<ReportsBase>>
instead.
An std::vector
is the preferred container type in this case because the constant-time insertion and removal properties of std::list
are not needed. The smart pointer type std::unique_ptr<ReportsBase>
is preferred over ReportsBase *
because it eliminates the need for manual pointer deletion at the end of the function.
Change History (2)
comment:1 Changed on 04/05/21 at 18:35:16 by Joel Sherrill
Component: | admin → tool |
---|---|
Description: | modified (diff) |
Keywords: | covoar added |
Summary: | covoar/ReportsBase Coverage::GenerateReports() uses raw pointer std::list → covoar/ReportsBase Coverage::GenerateReports() uses raw pointer to std::list |
comment:2 Changed on 12/22/21 at 14:35:57 by Ryan Long <ryan.long@…>
Owner: | set to Ryan Long <ryan.long@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
In 8167ad2/rtems-tools: