MCPcopy Create free account
hub / github.com/ReZeroS/git / nextMisMatch

Method nextMisMatch

src/main/java/club/qqtim/diff/DiffUtil.java:249–263  ·  view source on GitHub ↗
(int indexOrigin, int indexHead, int indexOther,
                          List<LineObject> headLines, List<LineObject> otherLines,
                          Map<Integer, Integer> matchBaseHead, Map<Integer, Integer> matchBaseOther)

Source from the content-addressed store, hash-verified

247
248
249 private static int nextMisMatch(int indexOrigin, int indexHead, int indexOther,
250 List<LineObject> headLines, List<LineObject> otherLines,
251 Map<Integer, Integer> matchBaseHead, Map<Integer, Integer> matchBaseOther){
252 for (int i = 1; i <= headLines.size() && i <= otherLines.size(); i++) {
253 final Integer head = matchBaseHead.get(indexOrigin + i);
254 final Integer other = matchBaseOther.get(indexOrigin + i);
255
256 if (Objects.isNull(head) || !head.equals(indexHead + i)
257 || Objects.isNull(other) || !other.equals(indexOther + i)) {
258 return i;
259 }
260
261 }
262 return 0;
263 }
264
265 private static MergePoint nextMatch(int indexOrigin, List<LineObject> originLines,
266 Map<Integer, Integer> matchBaseHead, Map<Integer, Integer> matchBaseOther) {

Callers 1

mergeBlobsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected