From 2b9890e9b940db59b4d1633fa5b8067f615ed0f4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 14 Jun 2021 15:32:31 -0400 Subject: cmScanDepFormat: Avoid writing lookup-method with default value --- Source/cmScanDepFormat.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmScanDepFormat.cxx b/Source/cmScanDepFormat.cxx index 6620221..ae0e649 100644 --- a/Source/cmScanDepFormat.cxx +++ b/Source/cmScanDepFormat.cxx @@ -3,7 +3,6 @@ #include "cmScanDepFormat.h" -#include #include #include #include @@ -339,7 +338,7 @@ bool cmScanDepFormat_P1689_Write(std::string const& path, const char* lookup_method = nullptr; switch (require.Method) { case LookupMethod::ByName: - lookup_method = "by-name"; + // No explicit value needed for the default. break; case LookupMethod::IncludeAngle: lookup_method = "include-angle"; @@ -348,8 +347,9 @@ bool cmScanDepFormat_P1689_Write(std::string const& path, lookup_method = "include-quote"; break; } - assert(lookup_method); - require_obj["lookup-method"] = lookup_method; + if (lookup_method) { + require_obj["lookup-method"] = lookup_method; + } reqs.append(require_obj); } -- cgit v0.12