Skip to content

Commit 11d1f63

Browse files
committed
code cleanup
1 parent f5d0f82 commit 11d1f63

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

arraymap.c

-16
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ typedef struct FAMIObject {
452452
Py_ssize_t index; // current index state, mutated in-place
453453
} FAMIObject;
454454

455-
456455
static void
457456
fami_dealloc(FAMIObject *self)
458457
{
@@ -551,7 +550,6 @@ static PyTypeObject FAMIType = {
551550
.tp_name = "arraymap.FrozenAutoMapIterator",
552551
};
553552

554-
555553
static PyObject *
556554
fami_new(FAMObject *fam, ViewKind kind, bool reversed)
557555
{
@@ -602,27 +600,23 @@ name(PyObject *left, PyObject *right) \
602600
return result; \
603601
}
604602

605-
606603
FAMV_SET_OP(famv_and, And)
607604
FAMV_SET_OP(famv_or, Or)
608605
FAMV_SET_OP(famv_subtract, Subtract)
609606
FAMV_SET_OP(famv_xor, Xor)
610607

611608
# undef FAMV_SET_OP
612609

613-
614610
static PyNumberMethods famv_as_number = {
615611
.nb_and = (binaryfunc) famv_and,
616612
.nb_or = (binaryfunc) famv_or,
617613
.nb_subtract = (binaryfunc) famv_subtract,
618614
.nb_xor = (binaryfunc) famv_xor,
619615
};
620616

621-
622617
static int fam_contains(FAMObject *, PyObject *);
623618
static PyObject *famv_fami_new(FAMVObject *);
624619

625-
626620
static int
627621
famv_contains(FAMVObject *self, PyObject *other)
628622
{
@@ -638,41 +632,35 @@ famv_contains(FAMVObject *self, PyObject *other)
638632
return result;
639633
}
640634

641-
642635
static PySequenceMethods famv_as_sequence = {
643636
.sq_contains = (objobjproc) famv_contains,
644637
};
645638

646-
647639
static void
648640
famv_dealloc(FAMVObject *self)
649641
{
650642
Py_DECREF(self->fam);
651643
PyObject_Del((PyObject *)self);
652644
}
653645

654-
655646
static PyObject *
656647
famv_fami_new(FAMVObject *self)
657648
{
658649
return fami_new(self->fam, self->kind, false);
659650
}
660651

661-
662652
static PyObject *
663653
famv_length_hint(FAMVObject *self)
664654
{
665655
return PyLong_FromSsize_t(self->fam->keys_size);
666656
}
667657

668-
669658
static PyObject *
670659
famv_reversed(FAMVObject *self)
671660
{
672661
return fami_new(self->fam, self->kind, true);
673662
}
674663

675-
676664
static PyObject *
677665
famv_isdisjoint(FAMVObject *self, PyObject *other)
678666
{
@@ -685,7 +673,6 @@ famv_isdisjoint(FAMVObject *self, PyObject *other)
685673
return PyBool_FromLong(result);
686674
}
687675

688-
689676
static PyObject *
690677
famv_richcompare(FAMVObject *self, PyObject *other, int op)
691678
{
@@ -704,15 +691,13 @@ famv_richcompare(FAMVObject *self, PyObject *other, int op)
704691
return result;
705692
}
706693

707-
708694
static PyMethodDef famv_methods[] = {
709695
{"__length_hint__", (PyCFunction) famv_length_hint, METH_NOARGS, NULL},
710696
{"__reversed__", (PyCFunction) famv_reversed, METH_NOARGS, NULL},
711697
{"isdisjoint", (PyCFunction) famv_isdisjoint, METH_O, NULL},
712698
{NULL},
713699
};
714700

715-
716701
static PyTypeObject FAMVType = {
717702
PyVarObject_HEAD_INIT(NULL, 0)
718703
.tp_as_number = &famv_as_number,
@@ -725,7 +710,6 @@ static PyTypeObject FAMVType = {
725710
.tp_richcompare = (richcmpfunc) famv_richcompare,
726711
};
727712

728-
729713
static PyObject *
730714
famv_new(FAMObject *fam, ViewKind kind)
731715
{

0 commit comments

Comments
 (0)