@@ -123,13 +123,11 @@ OF_INVALID_INIT_METHOD } - (instancetype)initWithName: (OFString *)name { - return [self initWithName: name - namespace: nil - stringValue: nil]; + return [self initWithName: name namespace: nil stringValue: nil]; } - (instancetype)initWithName: (OFString *)name stringValue: (OFString *)stringValue { @@ -139,13 +137,11 @@ } - (instancetype)initWithName: (OFString *)name namespace: (OFString *)namespace { - return [self initWithName: name - namespace: namespace - stringValue: nil]; + return [self initWithName: name namespace: namespace stringValue: nil]; } - (instancetype)initWithName: (OFString *)name namespace: (OFString *)namespace stringValue: (OFString *)stringValue @@ -660,12 +656,11 @@ element = [OFXMLElement elementWithName: self.className namespace: OF_SERIALIZATION_NS]; if (_name != nil) - [element addAttributeWithName: @"name" - stringValue: _name]; + [element addAttributeWithName: @"name" stringValue: _name]; if (_namespace != nil) [element addAttributeWithName: @"namespace" stringValue: _namespace]; @@ -815,26 +810,23 @@ return; } } } -- (void)setPrefix: (OFString *)prefix - forNamespace: (OFString *)namespace +- (void)setPrefix: (OFString *)prefix forNamespace: (OFString *)namespace { if (prefix.length == 0) @throw [OFInvalidArgumentException exception]; if (namespace == nil) namespace = @""; [_namespaces setObject: prefix forKey: namespace]; } -- (void)bindPrefix: (OFString *)prefix - forNamespace: (OFString *)namespace +- (void)bindPrefix: (OFString *)prefix forNamespace: (OFString *)namespace { - [self setPrefix: prefix - forNamespace: namespace]; + [self setPrefix: prefix forNamespace: namespace]; [self addAttributeWithName: prefix namespace: @"http://www.w3.org/2000/xmlns/" stringValue: namespace]; } @@ -847,32 +839,28 @@ _children = [[OFMutableArray alloc] init]; [_children addObject: child]; } -- (void)insertChild: (OFXMLNode *)child - atIndex: (size_t)idx +- (void)insertChild: (OFXMLNode *)child atIndex: (size_t)idx { if ([child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; if (_children == nil) _children = [[OFMutableArray alloc] init]; - [_children insertObject: child - atIndex: idx]; + [_children insertObject: child atIndex: idx]; } -- (void)insertChildren: (OFArray *)children - atIndex: (size_t)idx +- (void)insertChildren: (OFArray *)children atIndex: (size_t)idx { for (OFXMLNode *node in children) if ([node isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; - [_children insertObjectsFromArray: children - atIndex: idx]; + [_children insertObjectsFromArray: children atIndex: idx]; } - (void)removeChild: (OFXMLNode *)child { if ([child isKindOfClass: [OFXMLAttribute class]]) @@ -884,29 +872,25 @@ - (void)removeChildAtIndex: (size_t)idx { [_children removeObjectAtIndex: idx]; } -- (void)replaceChild: (OFXMLNode *)child - withNode: (OFXMLNode *)node +- (void)replaceChild: (OFXMLNode *)child withNode: (OFXMLNode *)node { if ([node isKindOfClass: [OFXMLAttribute class]] || [child isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; - [_children replaceObject: child - withObject: node]; + [_children replaceObject: child withObject: node]; } -- (void)replaceChildAtIndex: (size_t)idx - withNode: (OFXMLNode *)node +- (void)replaceChildAtIndex: (size_t)idx withNode: (OFXMLNode *)node { if ([node isKindOfClass: [OFXMLAttribute class]]) @throw [OFInvalidArgumentException exception]; - [_children replaceObjectAtIndex: idx - withObject: node]; + [_children replaceObjectAtIndex: idx withObject: node]; } - (OFXMLElement *)elementForName: (OFString *)elementName { return [self elementsForName: elementName].firstObject;