File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -171,23 +171,20 @@ where
171171 /// The allocated elements are initially set to the identity.
172172 pub fn allocate_elements ( & mut self , n : usize ) -> Vec < PointVar > {
173173 let start = self . morphism . num_elements ;
174- let indices: Vec < usize > = ( start..start + n) . collect ( ) ;
175-
176174 self . morphism
177175 . group_elements
178176 . extend ( iter:: repeat ( G :: identity ( ) ) . take ( n) ) ;
179- let mut points = Vec :: new ( ) ;
180- for i in indices. iter ( ) {
181- points. push ( PointVar ( * i) ) ;
182- }
177+ let points = ( start..start + n)
178+ . map ( PointVar )
179+ . collect :: < Vec < _ > > ( ) ;
183180 self . morphism . num_elements += n;
184181 points
185182 }
186183
187184 /// Set the value of group elements at a given index, inside the list of allocated group elements.
188185 pub fn set_elements ( & mut self , elements : & [ ( PointVar , G ) ] ) {
189- for & ( i, ref elt) in elements {
190- self . morphism . group_elements [ i. 0 ] = * elt;
186+ for & ( i, elt) in elements {
187+ self . morphism . group_elements [ i. 0 ] = elt;
191188 }
192189 }
193190
You can’t perform that action at this time.
0 commit comments