ObjFW  Diff

Differences From Artifact [ac31f7403e]:

To Artifact [0600278cf2]:


22
23
24
25
26
27
28
29

30
31
32

33
34
35
36
37
38
39
22
23
24
25
26
27
28

29



30
31
32
33
34
35
36
37







-
+
-
-
-
+







#import "private.h"

struct objc_sparsearray *
objc_sparsearray_new(uint8_t levels)
{
	struct objc_sparsearray *sparsearray;

	if ((sparsearray = calloc(1, sizeof(*sparsearray))) == NULL)
	if ((sparsearray = calloc(1, sizeof(*sparsearray))) == NULL ||
		OBJC_ERROR("Failed to allocate memory for sparse array!");

	if ((sparsearray->data = calloc(1, sizeof(*sparsearray->data))) == NULL)
	    (sparsearray->data = calloc(1, sizeof(*sparsearray->data))) == NULL)
		OBJC_ERROR("Failed to allocate memory for sparse array!");

	sparsearray->levels = levels;

	return sparsearray;
}