Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Sep 10, 2012
1 parent 5794803 commit cd73f9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/classes/GRMustacheSection.m
Expand Up @@ -55,7 +55,7 @@ - (id)initWithSectionElement:(GRMustacheSectionElement *)sectionElement runtime:

- (NSString *)render
{
return [_sectionElement renderElementsInRuntime:_runtime];
return [_sectionElement renderInnerElementsInRuntime:_runtime];
}

- (NSString *)renderTemplateString:(NSString *)string error:(NSError **)outError
Expand Down
12 changes: 6 additions & 6 deletions src/classes/GRMustacheSectionElement.m
Expand Up @@ -92,7 +92,7 @@ - (NSString *)innerTemplateString
return [_templateString substringWithRange:_innerRange];
}

- (NSString *)renderElementsInRuntime:(GRMustacheRuntime *)runtime
- (NSString *)renderInnerElementsInRuntime:(GRMustacheRuntime *)runtime
{
NSMutableString *result = [NSMutableString string];
@autoreleasepool {
Expand Down Expand Up @@ -131,15 +131,15 @@ - (NSString *)renderInRuntime:(GRMustacheRuntime *)runtime
{
// False value
if (_inverted) {
result = [[self renderElementsInRuntime:sectionRuntime] retain];
result = [[self renderInnerElementsInRuntime:sectionRuntime] retain];
}
}
else if ([value isKindOfClass:[NSDictionary class]])
{
// True value
if (!_inverted) {
sectionRuntime = [sectionRuntime runtimeByAddingContextObject:value];
result = [[self renderElementsInRuntime:sectionRuntime] retain];
result = [[self renderInnerElementsInRuntime:sectionRuntime] retain];
}
}
else if ([value conformsToProtocol:@protocol(NSFastEnumeration)])
Expand All @@ -152,13 +152,13 @@ - (NSString *)renderInRuntime:(GRMustacheRuntime *)runtime
break;
}
if (empty) {
result = [[self renderElementsInRuntime:sectionRuntime] retain];
result = [[self renderInnerElementsInRuntime:sectionRuntime] retain];
}
} else {
result = [[NSMutableString string] retain];
for (id item in value) {
GRMustacheRuntime *itemRuntime = [sectionRuntime runtimeByAddingContextObject:item];
NSString *itemRendering = [self renderElementsInRuntime:itemRuntime];
NSString *itemRendering = [self renderInnerElementsInRuntime:itemRuntime];
[(NSMutableString *)result appendString:itemRendering];
}
}
Expand All @@ -176,7 +176,7 @@ - (NSString *)renderInRuntime:(GRMustacheRuntime *)runtime
// True value
if (!_inverted) {
sectionRuntime = [sectionRuntime runtimeByAddingContextObject:value];
result = [[self renderElementsInRuntime:sectionRuntime] retain];
result = [[self renderInnerElementsInRuntime:sectionRuntime] retain];
}
}
}];
Expand Down
2 changes: 1 addition & 1 deletion src/classes/GRMustacheSectionElement_private.h
Expand Up @@ -93,6 +93,6 @@
*
* @return The rendering of inner elements.
*/
- (NSString *)renderElementsInRuntime:(GRMustacheRuntime *)runtime GRMUSTACHE_API_INTERNAL;
- (NSString *)renderInnerElementsInRuntime:(GRMustacheRuntime *)runtime GRMUSTACHE_API_INTERNAL;

@end

0 comments on commit cd73f9c

Please sign in to comment.