MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / trim

Function trim

src/licensedcode/dmp.py:109–120  ·  view source on GitHub ↗

Remove trailing INSERT and DELETE from a list of diffs

(diffs)

Source from the content-addressed store, hash-verified

107
108
109def trim(diffs):
110 """
111 Remove trailing INSERT and DELETE from a list of diffs
112 """
113 # FIXME: this may be best done in the main loop?
114 while diffs:
115 op, _ = diffs[-1]
116 if op in (DIFF_DELETE, DIFF_INSERT):
117 diffs.pop()
118 else:
119 break
120 return diffs
121
122
123class Differ(object):

Callers 5

match_blocksFunction · 0.85
inspectPropertyMethod · 0.85
searchUsersMethod · 0.85
findUserMethod · 0.85

Calls 1

popMethod · 0.45

Tested by

no test coverage detected