File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -181,19 +181,19 @@ impl<'a> BinaryMatcher<'a> {
181181 /// Subsequent elements can be pushed using the `Atom::SaveCursor` atom or the `'` command within the binary pattern.
182182 /// - `None` if no further matches are available.
183183 pub fn next_match ( & mut self ) -> Option < & [ u32 ] > {
184- while self . match_offset < self . target . match_length ( ) {
185- let offset = self . match_offset ;
186- self . match_offset += 1 ;
187-
184+ for match_offset in self . match_offset ..self . target . match_length ( ) {
188185 self . save_stack . truncate ( 1 ) ;
189- self . save_stack [ 0 ] = offset as u32 ;
190-
191186 self . cursor_stack . truncate ( 0 ) ;
192187
193- if self . match_atoms ( offset, self . pattern . atoms ( ) ) . is_none ( ) {
188+ if self
189+ . match_atoms ( match_offset, self . pattern . atoms ( ) )
190+ . is_none ( )
191+ {
194192 continue ;
195193 }
196194
195+ self . match_offset = match_offset + 1 ;
196+ self . save_stack [ 0 ] = match_offset as u32 ;
197197 return Some ( & self . save_stack ) ;
198198 }
199199
You can’t perform that action at this time.
0 commit comments