Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make endIndex in getRange an optional positional argument, default to width #228

Closed
mkorbel1 opened this issue Dec 16, 2022 · 1 comment · Fixed by #231
Closed

Make endIndex in getRange an optional positional argument, default to width #228

mkorbel1 opened this issue Dec 16, 2022 · 1 comment · Fixed by #231
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mkorbel1
Copy link
Contributor

Motivation

It's relatively common to want to grab a bus or value from a certain bit all the way to the end, but right now that requires explicitly specifying the width as the end argument of getRange. It would be nice if supplying only the start would default to grabbing all the way to the end.

Desired solution

Modify getRange in both Logic and LogicValue so that endIndex is an optional positional argument:

... getRange(int startIndex, [int? endIndex]) {

If endIndex is null, then default the value of it to width.

Alternatives considered

No response

Additional details

No response

@mkorbel1 mkorbel1 added enhancement New feature or request good first issue Good for newcomers labels Dec 16, 2022
@quekyj
Copy link
Contributor

quekyj commented Dec 19, 2022

Hi @mkorbel1, let me investigate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants