Skip to content

Commit fe827c0

Browse files
committed
chore: pre-check path length
1 parent ed0c230 commit fe827c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

intersect.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function parsePathString(pathString) {
109109
*/
110110
function isPathAbsolute(pathComponents) {
111111

112-
for (var i = 0; i < pathComponents.length; i++) {
112+
for (var i = 0, ii = pathComponents.length; i < ii; i++) {
113113
var command = pathComponents[i][0];
114114
if (typeof command === 'string' && command !== command.toUpperCase()) {
115115
return false;
@@ -128,7 +128,8 @@ function isPathAbsolute(pathComponents) {
128128
* @return {boolean}
129129
*/
130130
function isPathCurve(pathComponents) {
131-
for (var i = 0; i < pathComponents.length; i++) {
131+
132+
for (var i = 0, ii = pathComponents.length; i < ii; i++) {
132133
var command = pathComponents[i][0];
133134
if (command !== 'M' && command !== 'C') {
134135
return false;

0 commit comments

Comments
 (0)