File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -230,11 +230,8 @@ unsafe fn ZDICT_analyzePos(
230230
231231 // exit if not found a minimum number of repetitions
232232 if end. wrapping_sub ( start) < minRatio {
233- let mut idx: u32 = 0 ;
234- idx = start;
235- while idx < end {
233+ for idx in start..end {
236234 doneMarks[ suffix ( idx as usize ) as usize ] = true ;
237- idx = idx. wrapping_add ( 1 ) ;
238235 }
239236 return solution;
240237 }
@@ -260,14 +257,11 @@ unsafe fn ZDICT_analyzePos(
260257 let mut currentChar = 0 ;
261258 let mut currentCount = 0u32 ;
262259 let mut currentID = refinedStart;
263- let mut id: u32 = 0 ;
264260 let mut selectedCount = 0 ;
265261 let mut selectedID = currentID;
266- id = refinedStart;
267- while id < refinedEnd {
268- if * b. offset ( ( suffix ( id as usize ) ) . wrapping_add ( mml) as isize ) as core:: ffi:: c_int
269- != currentChar as core:: ffi:: c_int
270- {
262+
263+ for id in refinedStart..refinedEnd {
264+ if * b. offset ( ( suffix ( id as usize ) ) . wrapping_add ( mml) as isize ) != currentChar {
271265 if currentCount > selectedCount {
272266 selectedCount = currentCount;
273267 selectedID = currentID;
@@ -277,8 +271,8 @@ unsafe fn ZDICT_analyzePos(
277271 currentCount = 0 ;
278272 }
279273 currentCount = currentCount. wrapping_add ( 1 ) ;
280- id = id. wrapping_add ( 1 ) ;
281274 }
275+
282276 if currentCount > selectedCount {
283277 selectedCount = currentCount;
284278 selectedID = currentID;
You can’t perform that action at this time.
0 commit comments