@@ -255,15 +255,6 @@ struct scoreboard {
255
255
int * lineno ;
256
256
};
257
257
258
- static inline int same_suspect (struct origin * a , struct origin * b )
259
- {
260
- if (a == b )
261
- return 1 ;
262
- if (a -> commit != b -> commit )
263
- return 0 ;
264
- return !strcmp (a -> path , b -> path );
265
- }
266
-
267
258
static void sanity_check_refcnt (struct scoreboard * );
268
259
269
260
/*
@@ -276,7 +267,7 @@ static void coalesce(struct scoreboard *sb)
276
267
struct blame_entry * ent , * next ;
277
268
278
269
for (ent = sb -> ent ; ent && (next = ent -> next ); ent = next ) {
279
- if (same_suspect ( ent -> suspect , next -> suspect ) &&
270
+ if (ent -> suspect == next -> suspect &&
280
271
ent -> guilty == next -> guilty &&
281
272
ent -> s_lno + ent -> num_lines == next -> s_lno ) {
282
273
ent -> num_lines += next -> num_lines ;
@@ -735,7 +726,7 @@ static int find_last_in_target(struct scoreboard *sb, struct origin *target)
735
726
int last_in_target = -1 ;
736
727
737
728
for (e = sb -> ent ; e ; e = e -> next ) {
738
- if (e -> guilty || ! same_suspect ( e -> suspect , target ) )
729
+ if (e -> guilty || e -> suspect != target )
739
730
continue ;
740
731
if (last_in_target < e -> s_lno + e -> num_lines )
741
732
last_in_target = e -> s_lno + e -> num_lines ;
@@ -755,7 +746,7 @@ static void blame_chunk(struct scoreboard *sb,
755
746
struct blame_entry * e ;
756
747
757
748
for (e = sb -> ent ; e ; e = e -> next ) {
758
- if (e -> guilty || ! same_suspect ( e -> suspect , target ) )
749
+ if (e -> guilty || e -> suspect != target )
759
750
continue ;
760
751
if (same <= e -> s_lno )
761
752
continue ;
@@ -985,7 +976,7 @@ static int find_move_in_parent(struct scoreboard *sb,
985
976
while (made_progress ) {
986
977
made_progress = 0 ;
987
978
for (e = sb -> ent ; e ; e = e -> next ) {
988
- if (e -> guilty || ! same_suspect ( e -> suspect , target ) ||
979
+ if (e -> guilty || e -> suspect != target ||
989
980
ent_score (sb , e ) < blame_move_score )
990
981
continue ;
991
982
find_copy_in_blob (sb , e , parent , split , & file_p );
@@ -1020,14 +1011,14 @@ static struct blame_list *setup_blame_list(struct scoreboard *sb,
1020
1011
1021
1012
for (e = sb -> ent , num_ents = 0 ; e ; e = e -> next )
1022
1013
if (!e -> scanned && !e -> guilty &&
1023
- same_suspect ( e -> suspect , target ) &&
1014
+ e -> suspect == target &&
1024
1015
min_score < ent_score (sb , e ))
1025
1016
num_ents ++ ;
1026
1017
if (num_ents ) {
1027
1018
blame_list = xcalloc (num_ents , sizeof (struct blame_list ));
1028
1019
for (e = sb -> ent , i = 0 ; e ; e = e -> next )
1029
1020
if (!e -> scanned && !e -> guilty &&
1030
- same_suspect ( e -> suspect , target ) &&
1021
+ e -> suspect == target &&
1031
1022
min_score < ent_score (sb , e ))
1032
1023
blame_list [i ++ ].ent = e ;
1033
1024
}
@@ -1171,7 +1162,7 @@ static void pass_whole_blame(struct scoreboard *sb,
1171
1162
origin -> file .ptr = NULL ;
1172
1163
}
1173
1164
for (e = sb -> ent ; e ; e = e -> next ) {
1174
- if (! same_suspect ( e -> suspect , origin ) )
1165
+ if (e -> suspect != origin )
1175
1166
continue ;
1176
1167
origin_incref (porigin );
1177
1168
origin_decref (e -> suspect );
@@ -1560,7 +1551,7 @@ static void assign_blame(struct scoreboard *sb, int opt)
1560
1551
1561
1552
/* Take responsibility for the remaining entries */
1562
1553
for (ent = sb -> ent ; ent ; ent = ent -> next )
1563
- if (same_suspect ( ent -> suspect , suspect ) )
1554
+ if (ent -> suspect == suspect )
1564
1555
found_guilty_entry (ent );
1565
1556
origin_decref (suspect );
1566
1557
0 commit comments