File tree 1 file changed +10
-17
lines changed
1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -273,23 +273,16 @@ impl IndexFile {
273
273
+ self . hash_slot_num * HASH_SLOT_SIZE
274
274
+ next_index_to_read as usize * INDEX_SIZE ;
275
275
276
- let key_hash_read =
277
- i32:: from_be_bytes ( buffer[ abs_index_pos..abs_index_pos + 4 ] . try_into ( ) . unwrap ( ) ) ;
278
- let phy_offset_read = i64:: from_be_bytes (
279
- buffer[ abs_index_pos + 4 ..abs_index_pos + 12 ]
280
- . try_into ( )
281
- . unwrap ( ) ,
282
- ) ;
283
- let time_diff = i32:: from_be_bytes (
284
- buffer[ abs_index_pos + 12 ..abs_index_pos + 16 ]
285
- . try_into ( )
286
- . unwrap ( ) ,
287
- ) ;
288
- let prev_index_read = i32:: from_be_bytes (
289
- buffer[ abs_index_pos + 16 ..abs_index_pos + 20 ]
290
- . try_into ( )
291
- . unwrap ( ) ,
292
- ) ;
276
+ let key_hash_read = buffer. slice ( abs_index_pos..abs_index_pos + 4 ) . get_i32 ( ) ;
277
+ let phy_offset_read = buffer
278
+ . slice ( abs_index_pos + 4 ..abs_index_pos + 12 )
279
+ . get_i64 ( ) ;
280
+ let time_diff = buffer
281
+ . slice ( abs_index_pos + 12 ..abs_index_pos + 16 )
282
+ . get_i32 ( ) ;
283
+ let prev_index_read = buffer
284
+ . slice ( abs_index_pos + 16 ..abs_index_pos + 20 )
285
+ . get_i32 ( ) ;
293
286
294
287
if time_diff < 0 {
295
288
break ;
You can’t perform that action at this time.
0 commit comments