BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

Simplify `Range<T>` usage and implementation, switching to half-open (end is exclusive)

Open YoshiRulz opened this issue 1 year ago • 3 comments

WIP, but the next part will be much harder, so if you want to review and merge don't wait for me.

After merge, need to remember to update https://github.com/TASEmulators/BizHawk/wiki/Available-C%23-and-.NET-features

YoshiRulz avatar Jul 10 '24 15:07 YoshiRulz

What's the WIP part about this? Could this just be merged as is or is something missing?

Morilli avatar Jul 10 '24 21:07 Morilli

It could be merged as-is. (It might be a good idea to have a unit test, at least before the refactor from closed to half-open, since that one changes some logic.) The part that's missing is to make Int32Interval half-open. It may also be possible to make them value types, in which case some or all uses of Int32Interval could be the BCL Range instead.

YoshiRulz avatar Jul 10 '24 21:07 YoshiRulz

What is the advantage of this? How is this simpler than the previous implementation, aside from removing unused code? ~~Why is Int32Interval closed while Int64Interval is half-open?~~ EDIT: You said above that changing that is "missing". I say change it before merging (if it's going to ever be merged).

SuuperW avatar Dec 03 '25 09:12 SuuperW