@@ -253,10 +253,6 @@ func (m *SequenceMatcher) chainB() {
253
253
m .b2j = b2j
254
254
}
255
255
256
- func (m * SequenceMatcher ) isBJunk (s []byte ) bool {
257
- return m .b2j .isBJunk (s )
258
- }
259
-
260
256
// Find longest matching block in a[alo:ahi] and b[blo:bhi].
261
257
//
262
258
// If IsJunk is not defined:
@@ -324,12 +320,12 @@ func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match {
324
320
// "popular" non-junk elements aren't in b2j, which greatly speeds
325
321
// the inner loop above, but also means "the best" match so far
326
322
// doesn't contain any junk *or* popular non-junk elements.
327
- for besti > alo && bestj > blo && ! m .isBJunk (m .b [bestj - 1 ]) &&
323
+ for besti > alo && bestj > blo && ! m .b2j . isBJunk (m .b [bestj - 1 ]) &&
328
324
bytes .Equal (m .a [besti - 1 ], m .b [bestj - 1 ]) {
329
325
besti , bestj , bestsize = besti - 1 , bestj - 1 , bestsize + 1
330
326
}
331
327
for besti + bestsize < ahi && bestj + bestsize < bhi &&
332
- ! m .isBJunk (m .b [bestj + bestsize ]) &&
328
+ ! m .b2j . isBJunk (m .b [bestj + bestsize ]) &&
333
329
bytes .Equal (m .a [besti + bestsize ], m .b [bestj + bestsize ]) {
334
330
bestsize += 1
335
331
}
@@ -341,12 +337,12 @@ func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match {
341
337
// figuring out what to do with it. In the case of an empty
342
338
// interesting match, this is clearly the right thing to do,
343
339
// because no other kind of match is possible in the regions.
344
- for besti > alo && bestj > blo && m .isBJunk (m .b [bestj - 1 ]) &&
340
+ for besti > alo && bestj > blo && m .b2j . isBJunk (m .b [bestj - 1 ]) &&
345
341
bytes .Equal (m .a [besti - 1 ], m .b [bestj - 1 ]) {
346
342
besti , bestj , bestsize = besti - 1 , bestj - 1 , bestsize + 1
347
343
}
348
344
for besti + bestsize < ahi && bestj + bestsize < bhi &&
349
- m .isBJunk (m .b [bestj + bestsize ]) &&
345
+ m .b2j . isBJunk (m .b [bestj + bestsize ]) &&
350
346
bytes .Equal (m .a [besti + bestsize ], m .b [bestj + bestsize ]) {
351
347
bestsize += 1
352
348
}
0 commit comments