• R/O
  • HTTP
  • SSH
  • HTTPS

winmerge-jp: Commit


Commit MetaInfo

Revision96c805261fc920d329e7ef56d1cd1586161c3c3b (tree)
Zeit2018-10-28 23:47:48
AutorTakashi Sawanaka <sdottaka@user...>
CommiterTakashi Sawanaka

Log Message

DiffTextBuffer.cpp: Impletement 'TODO: speed this up via table lookup'

Ändern Zusammenfassung

Diff

--- a/Src/DiffTextBuffer.cpp
+++ b/Src/DiffTextBuffer.cpp
@@ -84,9 +84,8 @@ static void EscapeControlChars(String &s)
8484 // Is it a control character in the range 0..31 except TAB?
8585 if (!(c & ~_T('\x1F')) && c != _T('\t'))
8686 {
87- // TODO: speed this up via table lookup
88- // Bitwise OR with 0x100 so _itot_s() will output 3 hex digits
89- _itot_s(0x100 | c, p + n - 4, 4, 16);
87+ p[n - 4 + 1] = _T("0123456789ABCDEF")[(c >> 4) & 0xf];
88+ p[n - 4 + 2] = _T("0123456789ABCDEF")[c & 0xf];
9089 // Replace terminating zero with leadout character
9190 p[n - 1] = _T('\\');
9291 // Prepare to replace 1st hex digit with leadin character
Show on old repository browser