X Tutup
Skip to content

Replace ir::BlockIdx::NULL with Option<ir::BlockIdx> #7221

@ShaharNaveh

Description

@ShaharNaveh

Summary

We are using a hack for representing a null block index by doing:

impl BlockIdx {
pub const NULL: Self = Self::new(u32::MAX);

I think it would be better to remove this hack and using a proper Option<BlockIdx> for representing Some(BlockIdx) or a None it would ensure a proper care for a None/Some cases instead of using an if condition (which is more error prone) like:

if target == BlockIdx::NULL {
  ...
} else {
  ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup