ObjFW  Diff

Differences From Artifact [f1c4d45a2c]:

To Artifact [2312031144]:


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#define OF_MUTABLE_SET_HASHTABLE_M

#import "OFSet_hashtable.h"
#import "OFMutableSet_hashtable.h"
#import "OFMutableDictionary_hashtable.h"
#import "OFNumber.h"

@implementation OFMutableSet_hashtable
+ (void)initialize
{
	if (self == [OFMutableSet_hashtable class])
		[self inheritMethodsFromClass: [OFSet_hashtable class]];
}

- (void)addObject: (id)object
{
	[dictionary OF_setObject: [OFNumber numberWithSize: 1]
			  forKey: object
			 copyKey: NO];
}

- (void)removeObject: (id)object
{
	[dictionary removeObjectForKey: object];
}

- (void)makeImmutable
{
	object_setClass(self, [OFSet_hashtable class]);
}
@end







<
<


<
|










|
|
<




|







12
13
14
15
16
17
18


19
20

21
22
23
24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43
44
45
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"



#import "OFSet_hashtable.h"
#import "OFMutableSet_hashtable.h"

#import "OFMapTable.h"

@implementation OFMutableSet_hashtable
+ (void)initialize
{
	if (self == [OFMutableSet_hashtable class])
		[self inheritMethodsFromClass: [OFSet_hashtable class]];
}

- (void)addObject: (id)object
{
	[mapTable setValue: (void*)1
		    forKey: object];

}

- (void)removeObject: (id)object
{
	[mapTable removeValueForKey: object];
}

- (void)makeImmutable
{
	object_setClass(self, [OFSet_hashtable class]);
}
@end