KompareDiff2
7#include "stringlistpair.h"
13unsigned int StringListPair::lengthFirst()
const
18unsigned int StringListPair::lengthSecond()
const
20 return m_lengthSecond;
23MarkerList StringListPair::markerListFirst()
const
25 return m_markersFirst;
28MarkerList StringListPair::markerListSecond()
const
30 return m_markersSecond;
33void StringListPair::prependFirst(
Marker* marker)
38void StringListPair::prependSecond(
Marker* marker)
40 m_markersSecond.
prepend(marker);
44 : m_first(first), m_second(second)
47 m_lengthFirst = first.
length() + 1;
48 m_lengthSecond = second.
length() + 1;
50 m_hashesFirst =
new unsigned int[m_lengthFirst];
51 m_hashesSecond =
new unsigned int[m_lengthSecond];
54 for (
unsigned int i = 1; i < m_lengthFirst; ++i) {
55 m_hashesFirst[i] =
qHash(first[i - 1]);
58 for (
unsigned int i = 1; i < m_lengthSecond; ++i) {
59 m_hashesSecond[i] =
qHash(second[i - 1]);
63StringListPair::~StringListPair()
65 delete[] m_hashesFirst;
66 delete[] m_hashesSecond;
69bool StringListPair::equal(
unsigned int firstIndex,
unsigned int secondIndex)
const
71 if (m_hashesFirst[firstIndex] != m_hashesSecond[secondIndex]) {
74 if (firstIndex == 0 || secondIndex == 0) {
75 return firstIndex == 0 && secondIndex == 0;
77 return m_first[firstIndex - 1] == m_second[secondIndex - 1];
80bool StringListPair::needFineGrainedOutput(
unsigned int)
const
KTEXTEDITOR_EXPORT size_t qHash(KTextEditor::Cursor cursor, size_t seed=0) noexcept
qsizetype length() const const
void prepend(parameter_type value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:10:24 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.