From 438736068e10e6e9e620d27d803ed09d8d3233a0 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 7 Feb 2019 13:07:36 +0100 Subject: [PATCH] Remove opt_this param in forEach function --- src/ol/geom/flat/segments.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ol/geom/flat/segments.js b/src/ol/geom/flat/segments.js index fc5db5a7b2..c36d1a92b4 100644 --- a/src/ol/geom/flat/segments.js +++ b/src/ol/geom/flat/segments.js @@ -11,21 +11,19 @@ * @param {number} offset Offset. * @param {number} end End. * @param {number} stride Stride. - * @param {function(this: S, import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function + * @param {function(import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function * called for each segment. - * @param {S=} opt_this The object to be used as the value of 'this' - * within callback. * @return {T|boolean} Value. - * @template T,S + * @template T */ -export function forEach(flatCoordinates, offset, end, stride, callback, opt_this) { +export function forEach(flatCoordinates, offset, end, stride, callback) { const point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]]; const point2 = []; let ret; for (; (offset + stride) < end; offset += stride) { point2[0] = flatCoordinates[offset + stride]; point2[1] = flatCoordinates[offset + stride + 1]; - ret = callback.call(opt_this, point1, point2); + ret = callback(point1, point2); if (ret) { return ret; }