From d2df861e5071ff4279e99ed1773d5e1ea829853d Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 9 Nov 2021 11:29:29 +0100 Subject: [PATCH] Improves prefix sum computer docs. --- src/vs/editor/common/viewModel/prefixSumComputer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/editor/common/viewModel/prefixSumComputer.ts b/src/vs/editor/common/viewModel/prefixSumComputer.ts index eaf8faf4398..47ac2a2c65b 100644 --- a/src/vs/editor/common/viewModel/prefixSumComputer.ts +++ b/src/vs/editor/common/viewModel/prefixSumComputer.ts @@ -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;