Skip to content

Simplify OnDiskGraphIndex.View to avoid code duplication #458

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marianotepper
Copy link
Collaborator

@marianotepper marianotepper commented Apr 18, 2025

This PR adds two small improvements:

  1. The methods OnDiskGraphIndex.View.getVector and OnDiskGraphIndex.View.getVectorInto shared a significant amount of code. This PR makes getVector call getVectorInto, simplifying the code to avoid potential errors.
  2. The computation of the offsets for reading the file were (almost) duplicated in OnDiskGraphIndex.View.offsetFor and in OnDiskGraphIndex.View.neighborsOffsetFor. This PR refactors the computation so that the shared code goes into a common method.

@marianotepper marianotepper marked this pull request as ready for review April 18, 2025 21:03
@marianotepper marianotepper requested a review from tlwillke April 18, 2025 21:04
@marianotepper marianotepper changed the title Simplify ODGI.View.getVector to avoid code duplication Simplify OnDiskGraphIndex.View to avoid code duplication Apr 18, 2025
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