forked from qt-creator/qt-creator
UnifiedDiffData: Remove unused charNumber argument
Change-Id: I40331b4471a1aa716003943ecfb92a9ee7a4e406 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -296,15 +296,13 @@ void UnifiedDiffEditorWidget::setDiff(const QList<FileData> &diffFileList)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData &chunkData,
|
QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData &chunkData,
|
||||||
bool lastChunk, int *blockNumber, int *charNumber,
|
bool lastChunk, int *blockNumber, DiffSelections *selections)
|
||||||
DiffSelections *selections)
|
|
||||||
{
|
{
|
||||||
if (chunkData.contextChunk)
|
if (chunkData.contextChunk)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
QString diffText;
|
QString diffText;
|
||||||
int blockCount = 0;
|
int blockCount = 0;
|
||||||
int charCount = 0;
|
|
||||||
std::array<int, SideCount> lineCount{};
|
std::array<int, SideCount> lineCount{};
|
||||||
std::array<QList<TextLineData>, SideCount> buffer{};
|
std::array<QList<TextLineData>, SideCount> buffer{};
|
||||||
std::array<QList<int>, SideCount> rowsBuffer{};
|
std::array<QList<int>, SideCount> rowsBuffer{};
|
||||||
@@ -356,7 +354,6 @@ QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData
|
|||||||
++lineCount[side];
|
++lineCount[side];
|
||||||
}
|
}
|
||||||
diffText += line;
|
diffText += line;
|
||||||
charCount += line.count();
|
|
||||||
}
|
}
|
||||||
buffer[side].clear();
|
buffer[side].clear();
|
||||||
rowsBuffer[side].clear();
|
rowsBuffer[side].clear();
|
||||||
@@ -396,7 +393,6 @@ QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData
|
|||||||
blockCount += line.count('\n');
|
blockCount += line.count('\n');
|
||||||
}
|
}
|
||||||
diffText += line;
|
diffText += line;
|
||||||
charCount += line.count();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
processSideChunkDifferent(LeftSide, i, rowData);
|
processSideChunkDifferent(LeftSide, i, rowData);
|
||||||
@@ -419,7 +415,6 @@ QString UnifiedDiffData::setChunk(const DiffEditorInput &input, const ChunkData
|
|||||||
diffText.prepend(chunkLine);
|
diffText.prepend(chunkLine);
|
||||||
|
|
||||||
*blockNumber += blockCount + 1; // +1 for chunk line
|
*blockNumber += blockCount + 1; // +1 for chunk line
|
||||||
*charNumber += charCount + chunkLine.count();
|
|
||||||
return diffText;
|
return diffText;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,7 +424,6 @@ UnifiedDiffOutput UnifiedDiffData::diffOutput(QFutureInterface<void> &fi, int pr
|
|||||||
UnifiedDiffOutput output;
|
UnifiedDiffOutput output;
|
||||||
|
|
||||||
int blockNumber = 0;
|
int blockNumber = 0;
|
||||||
int charNumber = 0;
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
const int count = input.m_contextFileData.size();
|
const int count = input.m_contextFileData.size();
|
||||||
|
|
||||||
@@ -446,7 +440,6 @@ UnifiedDiffOutput UnifiedDiffData::diffOutput(QFutureInterface<void> &fi, int pr
|
|||||||
|
|
||||||
output.diffText += leftFileInfo;
|
output.diffText += leftFileInfo;
|
||||||
output.diffText += rightFileInfo;
|
output.diffText += rightFileInfo;
|
||||||
charNumber += leftFileInfo.count() + rightFileInfo.count();
|
|
||||||
|
|
||||||
if (fileData.binaryFiles) {
|
if (fileData.binaryFiles) {
|
||||||
output.foldingIndent.insert(blockNumber, 2);
|
output.foldingIndent.insert(blockNumber, 2);
|
||||||
@@ -458,7 +451,6 @@ UnifiedDiffOutput UnifiedDiffData::diffOutput(QFutureInterface<void> &fi, int pr
|
|||||||
+ fileData.fileInfo[RightSide].fileName
|
+ fileData.fileInfo[RightSide].fileName
|
||||||
+ " differ\n";
|
+ " differ\n";
|
||||||
output.diffText += binaryLine;
|
output.diffText += binaryLine;
|
||||||
charNumber += binaryLine.count();
|
|
||||||
} else {
|
} else {
|
||||||
for (int j = 0; j < fileData.chunks.count(); j++) {
|
for (int j = 0; j < fileData.chunks.count(); j++) {
|
||||||
const int oldBlockNumber = blockNumber;
|
const int oldBlockNumber = blockNumber;
|
||||||
@@ -467,7 +459,6 @@ UnifiedDiffOutput UnifiedDiffData::diffOutput(QFutureInterface<void> &fi, int pr
|
|||||||
(j == fileData.chunks.count() - 1)
|
(j == fileData.chunks.count() - 1)
|
||||||
&& fileData.lastChunkAtTheEndOfFile,
|
&& fileData.lastChunkAtTheEndOfFile,
|
||||||
&blockNumber,
|
&blockNumber,
|
||||||
&charNumber,
|
|
||||||
&output.selections);
|
&output.selections);
|
||||||
if (!fileData.chunks.at(j).contextChunk)
|
if (!fileData.chunks.at(j).contextChunk)
|
||||||
output.diffData.setChunkIndex(oldBlockNumber, blockNumber - oldBlockNumber, j);
|
output.diffData.setChunkIndex(oldBlockNumber, blockNumber - oldBlockNumber, j);
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ private:
|
|||||||
void setLineNumber(DiffSide side, int blockNumber, int lineNumber, int rowNumberInChunk);
|
void setLineNumber(DiffSide side, int blockNumber, int lineNumber, int rowNumberInChunk);
|
||||||
void setFileInfo(int blockNumber, const DiffFileInfo &leftInfo, const DiffFileInfo &rightInfo);
|
void setFileInfo(int blockNumber, const DiffFileInfo &leftInfo, const DiffFileInfo &rightInfo);
|
||||||
void setChunkIndex(int startBlockNumber, int blockCount, int chunkIndex);
|
void setChunkIndex(int startBlockNumber, int blockCount, int chunkIndex);
|
||||||
QString setChunk(const DiffEditorInput &input, const ChunkData &chunkData, bool lastChunk,
|
QString setChunk(const DiffEditorInput &input, const ChunkData &chunkData,
|
||||||
int *blockNumber, int *charNumber,
|
bool lastChunk, int *blockNumber, DiffSelections *selections);
|
||||||
DiffSelections *selections);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UnifiedDiffOutput
|
class UnifiedDiffOutput
|
||||||
|
|||||||
Reference in New Issue
Block a user