From ec2a3f3d9c9a720c02cea1fa0bbe84982016a51e Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 14 Nov 2019 10:49:05 +0500 Subject: [PATCH] Use const refs to avoid copying --- cpp/diff_match_patch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/diff_match_patch.cpp b/cpp/diff_match_patch.cpp index 64f270c..5cc2f20 100644 --- a/cpp/diff_match_patch.cpp +++ b/cpp/diff_match_patch.cpp @@ -234,7 +234,7 @@ QList diff_match_patch::diff_main(const QString &text1, } -QList diff_match_patch::diff_compute(QString text1, QString text2, +QList diff_match_patch::diff_compute(const QString &text1, const QString &text2, bool checklines, clock_t deadline) { QList diffs; @@ -1739,7 +1739,7 @@ QList diff_match_patch::patch_make(const QString &text1, } -QList diff_match_patch::patch_deepCopy(QList &patches) { +QList diff_match_patch::patch_deepCopy(const QList &patches) { QList patchesCopy; foreach(Patch aPatch, patches) { Patch patchCopy = Patch();