@@ -452,7 +452,6 @@ typedef struct FAMIObject {
452
452
Py_ssize_t index ; // current index state, mutated in-place
453
453
} FAMIObject ;
454
454
455
-
456
455
static void
457
456
fami_dealloc (FAMIObject * self )
458
457
{
@@ -551,7 +550,6 @@ static PyTypeObject FAMIType = {
551
550
.tp_name = "arraymap.FrozenAutoMapIterator" ,
552
551
};
553
552
554
-
555
553
static PyObject *
556
554
fami_new (FAMObject * fam , ViewKind kind , bool reversed )
557
555
{
@@ -602,27 +600,23 @@ name(PyObject *left, PyObject *right) \
602
600
return result; \
603
601
}
604
602
605
-
606
603
FAMV_SET_OP (famv_and , And )
607
604
FAMV_SET_OP (famv_or , Or )
608
605
FAMV_SET_OP (famv_subtract , Subtract )
609
606
FAMV_SET_OP (famv_xor , Xor )
610
607
611
608
# undef FAMV_SET_OP
612
609
613
-
614
610
static PyNumberMethods famv_as_number = {
615
611
.nb_and = (binaryfunc ) famv_and ,
616
612
.nb_or = (binaryfunc ) famv_or ,
617
613
.nb_subtract = (binaryfunc ) famv_subtract ,
618
614
.nb_xor = (binaryfunc ) famv_xor ,
619
615
};
620
616
621
-
622
617
static int fam_contains (FAMObject * , PyObject * );
623
618
static PyObject * famv_fami_new (FAMVObject * );
624
619
625
-
626
620
static int
627
621
famv_contains (FAMVObject * self , PyObject * other )
628
622
{
@@ -638,41 +632,35 @@ famv_contains(FAMVObject *self, PyObject *other)
638
632
return result ;
639
633
}
640
634
641
-
642
635
static PySequenceMethods famv_as_sequence = {
643
636
.sq_contains = (objobjproc ) famv_contains ,
644
637
};
645
638
646
-
647
639
static void
648
640
famv_dealloc (FAMVObject * self )
649
641
{
650
642
Py_DECREF (self -> fam );
651
643
PyObject_Del ((PyObject * )self );
652
644
}
653
645
654
-
655
646
static PyObject *
656
647
famv_fami_new (FAMVObject * self )
657
648
{
658
649
return fami_new (self -> fam , self -> kind , false);
659
650
}
660
651
661
-
662
652
static PyObject *
663
653
famv_length_hint (FAMVObject * self )
664
654
{
665
655
return PyLong_FromSsize_t (self -> fam -> keys_size );
666
656
}
667
657
668
-
669
658
static PyObject *
670
659
famv_reversed (FAMVObject * self )
671
660
{
672
661
return fami_new (self -> fam , self -> kind , true);
673
662
}
674
663
675
-
676
664
static PyObject *
677
665
famv_isdisjoint (FAMVObject * self , PyObject * other )
678
666
{
@@ -685,7 +673,6 @@ famv_isdisjoint(FAMVObject *self, PyObject *other)
685
673
return PyBool_FromLong (result );
686
674
}
687
675
688
-
689
676
static PyObject *
690
677
famv_richcompare (FAMVObject * self , PyObject * other , int op )
691
678
{
@@ -704,15 +691,13 @@ famv_richcompare(FAMVObject *self, PyObject *other, int op)
704
691
return result ;
705
692
}
706
693
707
-
708
694
static PyMethodDef famv_methods [] = {
709
695
{"__length_hint__" , (PyCFunction ) famv_length_hint , METH_NOARGS , NULL },
710
696
{"__reversed__" , (PyCFunction ) famv_reversed , METH_NOARGS , NULL },
711
697
{"isdisjoint" , (PyCFunction ) famv_isdisjoint , METH_O , NULL },
712
698
{NULL },
713
699
};
714
700
715
-
716
701
static PyTypeObject FAMVType = {
717
702
PyVarObject_HEAD_INIT (NULL , 0 )
718
703
.tp_as_number = & famv_as_number ,
@@ -725,7 +710,6 @@ static PyTypeObject FAMVType = {
725
710
.tp_richcompare = (richcmpfunc ) famv_richcompare ,
726
711
};
727
712
728
-
729
713
static PyObject *
730
714
famv_new (FAMObject * fam , ViewKind kind )
731
715
{
0 commit comments