MCPcopy Create free account
hub / github.com/WinMerge/winmerge / BuildWordDiffList

Method BuildWordDiffList

Src/stringdiffs.cpp:390–415  ·  view source on GitHub ↗

* @brief Add all different elements between lines to the wdiff list */

Source from the content-addressed store, hash-verified

388 * @brief Add all different elements between lines to the wdiff list
389 */
390void
391stringdiffs::BuildWordDiffList()
392{
393 m_words1 = BuildWordsArray(m_str1);
394 m_words2 = BuildWordsArray(m_str2);
395
396 bool succeeded = false;
397#ifdef _WIN64
398 if (m_words1.size() < 20480 && m_words2.size() < 20480)
399#else
400 if (m_words1.size() < 2048 && m_words2.size() < 2048)
401#endif
402 {
403 succeeded = BuildWordDiffList_DP();
404 }
405 if (!succeeded)
406 {
407 int s1 = m_words1[0].start;
408 int e1 = m_words1[m_words1.size() - 1].end;
409 int s2 = m_words2[0].start;
410 int e2 = m_words2[m_words2.size() - 1].end;
411 m_wdiffs.emplace_back(s1, e1, s2, e2);
412 return;
413 }
414
415}
416
417/**
418 * @brief Break line into constituent words

Callers 1

ComputeWordDiffsFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected