Skip to content

Commit

Permalink
Improves prefix sum computer docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Nov 9, 2021
1 parent 056fa40 commit d2df861
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vs/editor/common/viewModel/prefixSumComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class PrefixSumComputer {
return this._getPrefixSum(this.values.length - 1);
}

/**
* Returns the sum of the first `index + 1` many items.
* @returns `SUM(0 <= j <= index, values[j])`.
*/
public getPrefixSum(index: number): number {
if (index < 0) {
return 0;
Expand Down

0 comments on commit d2df861

Please sign in to comment.