@@ -273,14 +273,14 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
273
273
}
274
274
275
275
while ($ bestI > $ alo && $ bestJ > $ blo && !$ this ->isBJunk ($ b [$ bestJ - 1 ]) &&
276
- !$ this ->isLineDifferent ($ bestI - 1 , $ bestJ - 1 )) {
276
+ !$ this ->linesAreDifferent ($ bestI - 1 , $ bestJ - 1 )) {
277
277
--$ bestI ;
278
278
--$ bestJ ;
279
279
++$ bestSize ;
280
280
}
281
281
282
282
while ($ bestI + $ bestSize < $ ahi && ($ bestJ + $ bestSize ) < $ bhi &&
283
- !$ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) && !$ this ->isLineDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )) {
283
+ !$ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) && !$ this ->linesAreDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )) {
284
284
++$ bestSize ;
285
285
}
286
286
@@ -292,7 +292,7 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
292
292
}
293
293
294
294
while ($ bestI + $ bestSize < $ ahi && $ bestJ + $ bestSize < $ bhi &&
295
- $ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) && !$ this ->isLineDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )) {
295
+ $ this ->isBJunk ($ b [$ bestJ + $ bestSize ]) && !$ this ->linesAreDifferent ($ bestI + $ bestSize , $ bestJ + $ bestSize )) {
296
296
++$ bestSize ;
297
297
}
298
298
@@ -303,7 +303,14 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
303
303
);
304
304
}
305
305
306
- public function isLineDifferent ($ aIndex , $ bIndex )
306
+ /**
307
+ * Check if the two lines at the given indexes are different or not.
308
+ *
309
+ * @param int $aIndex Line number to check against in a.
310
+ * @param int $bIndex Line number to check against in b.
311
+ * @return boolean True if the lines are different and false if not.
312
+ */
313
+ public function linesAreDifferent ($ aIndex , $ bIndex )
307
314
{
308
315
$ lineA = $ this ->a [$ aIndex ];
309
316
$ lineB = $ this ->b [$ bIndex ];
0 commit comments