Revision: 5707
http://winmerge.svn.sourceforge.net/winmerge/?rev=5707&view=rev
Author: kimmov
Date: 2008-07-30 19:24:23 +0000 (Wed, 30 Jul 2008)
Log Message:
-----------
Optimize line replace. Don't bother clearing the string before setting new data to it.
Modified Paths:
--------------
trunk/Src/DiffTextBuffer.cpp
trunk/Src/MergeDoc.cpp
Modified: trunk/Src/DiffTextBuffer.cpp
===================================================================
--- trunk/Src/DiffTextBuffer.cpp 2008-07-30 19:23:10 UTC (rev 5706)
+++ trunk/Src/DiffTextBuffer.cpp 2008-07-30 19:24:23 UTC (rev 5707)
@@ -198,7 +198,8 @@
* This function is like GetLine() but it also includes line's EOL to the
* returned string.
* @param [in] nLineIndex Index of the line to get.
- * @param [out] strLine Returns line text in the index.
+ * @param [out] strLine Returns line text in the index. Existing content
+ * of this string is overwritten.
*/
BOOL CDiffTextBuffer::GetFullLine(int nLineIndex, CString &strLine)
{
Modified: trunk/Src/MergeDoc.cpp
===================================================================
--- trunk/Src/MergeDoc.cpp 2008-07-30 19:23:10 UTC (rev 5706)
+++ trunk/Src/MergeDoc.cpp 2008-07-30 19:24:23 UTC (rev 5707)
@@ -904,8 +904,7 @@
// copy the selected text over
for (int i=cd_dbegin; i <= limit; i++)
{
- // text exists on left side, so just replace
- strLine = _T("");
+ // text exists on other side, so just replace
sbuf.GetFullLine(i, strLine);
dbuf.ReplaceFullLine(dstView, i, strLine, CE_ACTION_MERGE);
dbuf.FlushUndoGroup(dstView);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|