Skip to content

Commit

Permalink
fix overflowing int for files larger than 2GB
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed May 10, 2024
1 parent c899285 commit 54fe767
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public int getMaxOrdinal() {

private long featureOffsetForOrdinal(int ordinal) {
int edgeSize = Integer.BYTES * (1 + graph.maxDegree());
int inlineBytes = ordinal * (Integer.BYTES + featureMap.values().stream().mapToInt(Feature::inlineSize).sum() + edgeSize);
long inlineBytes = ordinal * (long) (Integer.BYTES + featureMap.values().stream().mapToInt(Feature::inlineSize).sum() + edgeSize);
return startOffset
+ headerSize
+ inlineBytes // previous nodes
Expand Down

0 comments on commit 54fe767

Please sign in to comment.