Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve performance.

  • Loading branch information...
commit 8c20ada273559def2073c19df56c920c3cf357e9 1 parent 074f32a
@mikeabdullah mikeabdullah authored
Showing with 19 additions and 13 deletions.
  1. +18 −12 KSHTMLWriter.m
  2. +1 −1  KSWriter
View
30 KSHTMLWriter.m
@@ -420,19 +420,25 @@ + (BOOL)elementIsList:(NSString *)element;
- (BOOL)elementCanBeEmpty:(NSString *)tagName;
{
- if ([tagName isEqualToString:@"br"] ||
- [tagName isEqualToString:@"img"] ||
- [tagName isEqualToString:@"hr"] ||
- [tagName isEqualToString:@"meta"] ||
- [tagName isEqualToString:@"link"] ||
- [tagName isEqualToString:@"input"] ||
- [tagName isEqualToString:@"base"] ||
- [tagName isEqualToString:@"basefont"] ||
- [tagName isEqualToString:@"param"] ||
- [tagName isEqualToString:@"area"] ||
- [tagName isEqualToString:@"source"]) return YES;
+ static NSSet *emptyTags;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+
+ emptyTags = [[NSSet alloc] initWithObjects:
+ @"br",
+ @"img",
+ @"hr",
+ @"meta",
+ @"link",
+ @"input",
+ @"base",
+ @"basefont",
+ @"param",
+ @"area",
+ @"source", nil];
+ });
- return NO;
+ return [emptyTags containsObject:tagName];
}
+ (BOOL)shouldPrettyPrintElementInline:(NSString *)elementName;
2  KSWriter
@@ -1 +1 @@
-Subproject commit 708e5bffab202c723ef2ebec13099ee3a7743f3d
+Subproject commit 80afae4f0181d93383fb0b8097f0e39c0ddbfa0d
Please sign in to comment.
Something went wrong with that request. Please try again.