@@ -7,14 +7,14 @@ This file is trimmed to only the parts used by this repository.
7
7
*/
8
8
package difflib // import "gotest.tools/v3/internal/difflib"
9
9
10
- func min (a , b int ) int {
10
+ func minInt (a , b int ) int {
11
11
if a < b {
12
12
return a
13
13
}
14
14
return b
15
15
}
16
16
17
- func max (a , b int ) int {
17
+ func maxInt (a , b int ) int {
18
18
if a > b {
19
19
return a
20
20
}
@@ -397,12 +397,12 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode {
397
397
if codes [0 ].Tag == 'e' {
398
398
c := codes [0 ]
399
399
i1 , i2 , j1 , j2 := c .I1 , c .I2 , c .J1 , c .J2
400
- codes [0 ] = OpCode {c .Tag , max (i1 , i2 - n ), i2 , max (j1 , j2 - n ), j2 }
400
+ codes [0 ] = OpCode {c .Tag , maxInt (i1 , i2 - n ), i2 , maxInt (j1 , j2 - n ), j2 }
401
401
}
402
402
if codes [len (codes )- 1 ].Tag == 'e' {
403
403
c := codes [len (codes )- 1 ]
404
404
i1 , i2 , j1 , j2 := c .I1 , c .I2 , c .J1 , c .J2
405
- codes [len (codes )- 1 ] = OpCode {c .Tag , i1 , min (i2 , i1 + n ), j1 , min (j2 , j1 + n )}
405
+ codes [len (codes )- 1 ] = OpCode {c .Tag , i1 , minInt (i2 , i1 + n ), j1 , minInt (j2 , j1 + n )}
406
406
}
407
407
nn := n + n
408
408
groups := [][]OpCode {}
@@ -412,11 +412,11 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode {
412
412
// End the current group and start a new one whenever
413
413
// there is a large range with no changes.
414
414
if c .Tag == 'e' && i2 - i1 > nn {
415
- group = append (group , OpCode {c .Tag , i1 , min (i2 , i1 + n ),
416
- j1 , min (j2 , j1 + n )})
415
+ group = append (group , OpCode {c .Tag , i1 , minInt (i2 , i1 + n ),
416
+ j1 , minInt (j2 , j1 + n )})
417
417
groups = append (groups , group )
418
418
group = []OpCode {}
419
- i1 , j1 = max (i1 , i2 - n ), max (j1 , j2 - n )
419
+ i1 , j1 = maxInt (i1 , i2 - n ), maxInt (j1 , j2 - n )
420
420
}
421
421
group = append (group , OpCode {c .Tag , i1 , i2 , j1 , j2 })
422
422
}
0 commit comments