mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Refactor code to fit style rules
This commit is contained in:
parent
fc5bb4b10e
commit
f673542640
2 changed files with 4 additions and 4 deletions
|
@ -406,8 +406,9 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
if (append) {
|
if (append) {
|
||||||
// Append them all at the end.
|
// Append them all at the end.
|
||||||
// Use a loop as it is the best way to handle big arrays (see #1493)
|
// 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]);
|
segments.push(segs[i]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Insert somewhere else
|
// Insert somewhere else
|
||||||
segments.splice.apply(segments, [index, 0].concat(segs));
|
segments.splice.apply(segments, [index, 0].concat(segs));
|
||||||
|
|
|
@ -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() {
|
test('#1493 Path#add with 1000000 segments', function() {
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
for (var i=0; i<1000000; i++)
|
for (var i = 0; i < 1000000; i++) {
|
||||||
{
|
path.add(new Point(0, 0));
|
||||||
path.add(new Point(0,0));
|
|
||||||
}
|
}
|
||||||
path.clone();
|
path.clone();
|
||||||
expect(0);
|
expect(0);
|
||||||
|
|
Loading…
Reference in a new issue