@@ -113,7 +113,7 @@ public function setOptions(array $options)
113113 public function setSequences ($ a , $ b )
114114 {
115115 $ this ->setSeq1 ($ a )
116- ->setSeq2 ($ b );
116+ ->setSeq2 ($ b );
117117
118118 return $ this ;
119119 }
@@ -284,31 +284,31 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
284284 while ($ bestI > $ alo && $ bestJ > $ blo && !$ this ->isBJunk ($ b [$ bestJ - 1 ]) &&
285285 !$ this ->linesAreDifferent ($ bestI - 1 , $ bestJ - 1 )
286286 ) {
287- --$ bestI ;
288- --$ bestJ ;
289- ++$ bestSize ;
287+ --$ bestI ;
288+ --$ bestJ ;
289+ ++$ bestSize ;
290290 }
291291
292292 while ($ bestI + $ bestSize < $ ahi &&
293293 ($ bestJ + $ bestSize ) < $ bhi &&
294294 !$ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) &&
295295 !$ this ->linesAreDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )
296296 ) {
297- ++$ bestSize ;
297+ ++$ bestSize ;
298298 }
299299
300300 while ($ bestI > $ alo && $ bestJ > $ blo && $ this ->isBJunk ($ b [$ bestJ - 1 ]) &&
301- !$ this ->linesAreDifferent ($ bestI - 1 , $ bestJ - 1 )) {
302- --$ bestI ;
303- --$ bestJ ;
304- ++$ bestSize ;
301+ !$ this ->linesAreDifferent ($ bestI - 1 , $ bestJ - 1 )) {
302+ --$ bestI ;
303+ --$ bestJ ;
304+ ++$ bestSize ;
305305 }
306306
307307 while ($ bestI + $ bestSize < $ ahi &&
308308 $ bestJ + $ bestSize < $ bhi && $ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) &&
309309 !$ this ->linesAreDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )
310310 ) {
311- ++$ bestSize ;
311+ ++$ bestSize ;
312312 }
313313
314314 return [
@@ -367,16 +367,9 @@ public function getMatchingBlocks()
367367 $ aLength = count ($ this ->a );
368368 $ bLength = count ($ this ->b );
369369
370- $ queue = [
371- [
372- 0 ,
373- $ aLength ,
374- 0 ,
375- $ bLength
376- ]
377- ];
378-
370+ $ queue = [[0 , $ aLength , 0 , $ bLength ]];
379371 $ matchingBlocks = [];
372+
380373 while (!empty ($ queue )) {
381374 list ($ alo , $ ahi , $ blo , $ bhi ) = array_pop ($ queue );
382375 $ x = $ this ->findLongestMatch ($ alo , $ ahi , $ blo , $ bhi );
@@ -408,7 +401,8 @@ public function getMatchingBlocks()
408401 $ i1 = 0 ;
409402 $ j1 = 0 ;
410403 $ k1 = 0 ;
411- $ nonAdjacent = [$ this , 'tupleSort ' ];
404+ $ nonAdjacent = [];
405+
412406 foreach ($ matchingBlocks as $ block ) {
413407 list ($ i2 , $ j2 , $ k2 ) = $ block ;
414408
0 commit comments