Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SVGEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ CGPathRef CGPathFromSVGPathString(NSString *svgString) {
dispatch_once(&onceToken, ^{
commands = [NSCharacterSet characterSetWithCharactersInString:kValidSVGCommands];
separators = [NSMutableCharacterSet characterSetWithCharactersInString:@","];
[(NSMutableCharacterSet *)separators formUnionWithCharacterSet:NSCharacterSet.whitespaceAndNewlineCharacterSet];
[(NSMutableCharacterSet *)separators formUnionWithCharacterSet:NSCharacterSet.newlineCharacterSet];
});
scanner.charactersToBeSkipped = separators;

Expand All @@ -549,7 +549,7 @@ CGPathRef CGPathFromSVGPathString(NSString *svgString) {
scanner.scanLocation -= 2;
}
for (NSUInteger i = 0; i < zeros; ++i) { _operands.push_back(0.0); }

while ([scanner scanCharactersFromSet:[NSCharacterSet whitespaceCharacterSet] intoString:NULL]) { }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there an empty while loop here? isn't this an infinite loop

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not an infinite loop. It will move the scanner to next char if the current char is a whitespace.

float operand;
if (![scanner scanFloat:&operand]) {
break;
Expand Down
Loading