From f6735426402eb5800a22a09b4d0ee562e3d09a39 Mon Sep 17 00:00:00 2001 From: sasensi Date: Tue, 2 Oct 2018 19:28:35 +0200 Subject: [PATCH] Refactor code to fit style rules --- src/path/Path.js | 3 ++- test/tests/Path.js | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index 81bcfa05..c270a2ca 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -406,8 +406,9 @@ var Path = PathItem.extend(/** @lends Path# */{ if (append) { // Append them all at the end. // Use a loop as it is the best way to handle big arrays (see #1493) - for (var i = 0; i < segs.length; i++) + for (var i = 0, l = segs.length; i < l; i++) { segments.push(segs[i]); + } } else { // Insert somewhere else segments.splice.apply(segments, [index, 0].concat(segs)); diff --git a/test/tests/Path.js b/test/tests/Path.js index 70cd401e..ae190b10 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -614,9 +614,8 @@ test('Path#arcTo(from, through, to); where from, through and to all share the sa test('#1493 Path#add with 1000000 segments', function() { var path = new Path(); - for (var i=0; i<1000000; i++) - { - path.add(new Point(0,0)); + for (var i = 0; i < 1000000; i++) { + path.add(new Point(0, 0)); } path.clone(); expect(0);