File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ struct DictItem {
5050 savings : u32 ,
5151}
5252
53+ impl DictItem {
54+ fn init ( & mut self ) {
55+ self . pos = 1 ;
56+ self . length = 0 ;
57+ self . savings = -1i32 as u32 ;
58+ }
59+ }
60+
5361const MINRATIO : core:: ffi:: c_int = 4 ;
5462const ZDICT_MAX_SAMPLES_SIZE : core:: ffi:: c_uint = ( 2000 ) << 20 ;
5563#[ expect( deprecated) ]
@@ -134,12 +142,6 @@ unsafe fn ZDICT_count(
134142 }
135143}
136144
137- unsafe fn ZDICT_initDictItem ( d : * mut DictItem ) {
138- ( * d) . pos = 1 ;
139- ( * d) . length = 0 ;
140- ( * d) . savings = -( 1 as core:: ffi:: c_int ) as u32 ;
141- }
142-
143145const LLIMIT : core:: ffi:: c_int = 64 ;
144146const MINMATCHLENGTH : core:: ffi:: c_int = 7 ;
145147unsafe fn ZDICT_analyzePos (
@@ -1335,7 +1337,7 @@ unsafe fn ZDICT_trainFromBuffer_unsafe_legacy(
13351337 free ( dictList as * mut core:: ffi:: c_void ) ;
13361338 return Error :: dictionaryCreation_failed. to_error_code ( ) ;
13371339 }
1338- ZDICT_initDictItem ( dictList) ;
1340+ dictList. as_mut ( ) . unwrap ( ) . init ( ) ;
13391341 ZDICT_trainBuffer_legacy (
13401342 dictList,
13411343 dictListSize,
You can’t perform that action at this time.
0 commit comments