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 cr_overlap_any to test if there are any overlaps #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nh13
Copy link
Contributor

@nh13 nh13 commented May 10, 2022

This is a slight optimization when we only care if there exists an overlap, not which overlaps.

@@ -296,6 +297,47 @@ int64_t cr_overlap_int(const cgranges_t *cr, int32_t ctg_id, int32_t st, int32_t
return n;
}

bool cr_overlap_any_bool(const cgranges_t *cr, int32_t ctg_id, int32_t st, int32_t en)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is duplicated from cr_overlap_int. I could add an option to cr_overlap_int to just return 1 when the first overlapping interval is found, so that we have less code duplication.

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.

1 participant