@@ -92,7 +92,7 @@ impl streaming_iterator::StreamingIterator for IndividualTableRowView<'_> {
9292 self . flags = self . table . flags ( self . id ) . unwrap_or_else ( || 0 . into ( ) ) ;
9393 self . location = self . table . location ( self . id ) ;
9494 self . parents = self . table . parents ( self . id ) ;
95- self . metadata = self . table . raw_metadata ( self . id ) ;
95+ self . metadata = self . table . table_ . raw_metadata ( self . id ) ;
9696 }
9797}
9898
@@ -154,7 +154,7 @@ fn make_individual_table_row(table: &IndividualTable, pos: tsk_id_t) -> Option<I
154154 flags : table. flags ( pos) ?,
155155 location : table. location ( pos) . map ( |s| s. to_vec ( ) ) ,
156156 parents : table. parents ( pos) . map ( |s| s. to_vec ( ) ) ,
157- metadata : table. raw_metadata ( pos) . map ( |m| m. to_vec ( ) ) ,
157+ metadata : table. table_ . raw_metadata ( pos) . map ( |m| m. to_vec ( ) ) ,
158158 } )
159159}
160160
@@ -195,8 +195,6 @@ impl IndividualTable {
195195 self . table_ . as_ref ( )
196196 }
197197
198- raw_metadata_getter_for_tables ! ( IndividualId ) ;
199-
200198 /// Return the number of rows
201199 pub fn num_rows ( & self ) -> crate :: SizeType {
202200 self . as_ref ( ) . num_rows . into ( )
@@ -219,19 +217,7 @@ impl IndividualTable {
219217 /// * `Some(location)` if `row` is valid.
220218 /// * `None` otherwise.
221219 pub fn location < I : Into < IndividualId > + Copy > ( & self , row : I ) -> Option < & [ Location ] > {
222- assert ! (
223- ( self . num_rows( ) == 0 && self . as_ref( ) . location_length == 0 )
224- || ( !self . as_ref( ) . location. is_null( ) && !self . as_ref( ) . location_offset. is_null( ) )
225- ) ;
226- unsafe {
227- sys:: tsk_ragged_column_access (
228- row. into ( ) ,
229- self . as_ref ( ) . location ,
230- self . num_rows ( ) ,
231- self . as_ref ( ) . location_offset ,
232- self . as_ref ( ) . location_length ,
233- )
234- }
220+ self . table_ . location ( row. into ( ) )
235221 }
236222
237223 /// Return the parents for a given row.
@@ -241,19 +227,7 @@ impl IndividualTable {
241227 /// * `Some(parents)` if `row` is valid.
242228 /// * `None` otherwise.
243229 pub fn parents < I : Into < IndividualId > + Copy > ( & self , row : I ) -> Option < & [ IndividualId ] > {
244- assert ! (
245- ( self . num_rows( ) == 0 && self . as_ref( ) . parents_length == 0 )
246- || ( !self . as_ref( ) . parents. is_null( ) && !self . as_ref( ) . location_offset. is_null( ) )
247- ) ;
248- unsafe {
249- sys:: tsk_ragged_column_access (
250- row. into ( ) ,
251- self . as_ref ( ) . parents ,
252- self . num_rows ( ) ,
253- self . as_ref ( ) . parents_offset ,
254- self . as_ref ( ) . parents_length ,
255- )
256- }
230+ self . table_ . parents ( row. into ( ) )
257231 }
258232
259233 /// Return the metadata for a given row.
@@ -430,7 +404,7 @@ match tables.individuals().metadata::<MutationMetadata>(0)
430404 & self ,
431405 row : impl Into < IndividualId > ,
432406 ) -> Option < Result < T , TskitError > > {
433- let buffer = self . raw_metadata ( row) ?;
407+ let buffer = self . table_ . raw_metadata ( row) ?;
434408 Some ( decode_metadata_row ! ( T , buffer) . map_err ( |e| e. into ( ) ) )
435409 }
436410
@@ -477,7 +451,7 @@ match tables.individuals().metadata::<MutationMetadata>(0)
477451 flags : self . flags ( r) ?,
478452 location : self . location ( r) ,
479453 parents : self . parents ( r) ,
480- metadata : self . raw_metadata ( r. into ( ) ) ,
454+ metadata : self . table_ . raw_metadata ( r. into ( ) ) ,
481455 } ;
482456 Some ( view)
483457 }
0 commit comments