Skip to content

Commit

Permalink
Define null_id_vec for readability. Fixes #993.
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsAsplund committed Mar 1, 2024
1 parent e9400b9 commit a52fd21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vunit/vhdl/data_types/src/id_pkg.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package id_pkg is
end record;
constant null_id : id_t := (p_data => null_ptr);
type id_vec_t is array (integer range <>) of id_t;
constant null_id_vec : id_vec_t := (1 to 0 => null_id);

-- root_id is a nameless and predefined ID that is the parent to
-- all user created top-level IDs (no parent was specified at creation)
Expand Down Expand Up @@ -348,7 +349,7 @@ package body id_pkg is
begin
if id = null_id then
null_id_failure("get_lineage");
return (1 to 0 => null_id);
return null_id_vec;
elsif id = root_id then
return (1 => root_id);
end if;
Expand Down

0 comments on commit a52fd21

Please sign in to comment.