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

Add range assertions and docs #35

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

jacek-lewandowski
Copy link
Contributor

No description provided.

@@ -41,6 +41,11 @@

AbstractRanges(@Nonnull Range[] ranges)
{
if (ranges.length > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually permit double nesting of no braces, the outer statement is usually braced (esp. when mixing if+for)

@@ -366,4 +371,10 @@ public Range toUnseekable()
{
return this;
}

void checkRangeType(Range that)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final?

if (this.compareIntersecting(that) != 0)
return null;

if (this.contains(that))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably more efficient to check start == this.start && end == this.end below

if (this.contains(that))
return that;

if (that.contains(this))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably more efficient to check start == that.start && end == that.end below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants