summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDiff
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-15 21:46:23 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 22:14:30 +0100
commit9229ba0fe9b04a7eab116925ecdee4797815281d (patch)
tree2c9cb9724afebafb545f6e79cfcd62bb0c40f3c5 /Userland/Libraries/LibDiff
parent27bc48e06cf54cb826fd8dd46edd9331650f3a63 (diff)
downloadserenity-9229ba0fe9b04a7eab116925ecdee4797815281d.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Userland/Libraries/LibDiff')
-rw-r--r--Userland/Libraries/LibDiff/Hunks.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/Userland/Libraries/LibDiff/Hunks.cpp b/Userland/Libraries/LibDiff/Hunks.cpp
index d806b2b386..2d9c77405a 100644
--- a/Userland/Libraries/LibDiff/Hunks.cpp
+++ b/Userland/Libraries/LibDiff/Hunks.cpp
@@ -25,8 +25,7 @@
*/
#include "Hunks.h"
-
-// #define DEBUG_HUNKS
+#include <AK/Debug.h>
namespace Diff {
Vector<Hunk> parse_hunks(const String& diff)
@@ -78,21 +77,19 @@ Vector<Hunk> parse_hunks(const String& diff)
hunks.append(hunk);
}
-#ifdef DEBUG_HUNKS
- for (const auto& hunk : hunks) {
- dbgln("Hunk location:");
- dbg() << "orig: " << hunk.original_start_line;
- dbg() << "target: " << hunk.target_start_line;
- dbgln("removed:");
- for (const auto& line : hunk.removed_lines) {
- dbg() << "- " << line;
- }
- dbgln("added:");
- for (const auto& line : hunk.added_lines) {
- dbg() << "+ " << line;
+ if constexpr (debug_hunks) {
+ for (const auto& hunk : hunks) {
+ dbgln("Hunk location:");
+ dbgln(" orig: {}", hunk.original_start_line);
+ dbgln(" target: {}", hunk.target_start_line);
+ dbgln(" removed:");
+ for (const auto& line : hunk.removed_lines)
+ dbgln("- {}", line);
+ dbgln(" added:");
+ for (const auto& line : hunk.added_lines)
+ dbgln("+ {}", line);
}
}
-#endif
return hunks;
}