Differences From Artifact [cd05f3d64e]:
- File src/OFCountedSet_hashtable.m — part of check-in [cfd374b906] at 2015-01-03 20:57:18 on branch trunk — Update copyright (user: js, size: 4989) [annotate] [blame] [check-ins using]
To Artifact [87ab020669]:
- File
src/OFCountedSet_hashtable.m
— part of check-in
[6b13727ce0]
at
2015-11-29 14:02:11
on branch trunk
— Make use of fast enumeration
Now that we require GCC >= 4.6 anyway, there's no more reason to not use
it anymore. (user: js, size: 4636) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
41 42 43 44 45 46 47 | self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); if ([set isKindOfClass: [OFCountedSet class]]) { OFCountedSet *countedSet = (OFCountedSet*)countedSet; | < < < | | < | < < < | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); if ([set isKindOfClass: [OFCountedSet class]]) { OFCountedSet *countedSet = (OFCountedSet*)countedSet; for (id object in countedSet) { size_t i, count; count = [countedSet countForObject: object]; for (i = 0; i < count; i++) [self addObject: object]; } } else for (id object in set) [self addObject: object]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } |
︙ | ︙ | |||
132 133 134 135 136 137 138 | - initWithSerialization: (OFXMLElement*)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); | < < < > | | < < < | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - initWithSerialization: (OFXMLElement*)element { self = [self init]; @try { void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: @"OFCountedSet"] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exception]; for (OFXMLElement *objectElement in [element elementsForName: @"object" namespace: OF_SERIALIZATION_NS]) { void *pool2 = objc_autoreleasePoolPush(); OFXMLElement *object; OFXMLAttribute *count_; size_t count; object = [[objectElement elementsForNamespace: OF_SERIALIZATION_NS] firstObject]; |
︙ | ︙ |