From 59ea62abe3b5a6f49fa41d6aefefda48300b4dff Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 17 Nov 2016 18:08:12 +0000 Subject: Rewrite all Property related functions in terms of StringRef. This was a bit tricky, especially for things like OptionValueArray and OptionValueDictionary since they do some funky string parsing. Rather than try to re-write line-by-line I tried to make the StringRef usage idiomatic, even though it meant often re-writing from scratch large blocks of code in a different way while keeping true to the original intent. The finished code is a big improvement though, and often much shorter than the original code. All tests and unit tests pass on Windows and Linux. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@287242 91177308-0d34-0410-b5e6-96231b3b80d8 --- source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/Plugins/StructuredData') diff --git a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp index 2d2705c8f..5e1dd27e8 100644 --- a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -157,7 +157,7 @@ public: nullptr, idx, g_properties[idx].default_uint_value != 0); } - const char *GetAutoEnableOptions() const { + llvm::StringRef GetAutoEnableOptions() const { const uint32_t idx = ePropertyAutoEnableOptions; return m_collection_sp->GetPropertyAtIndexAsString( nullptr, idx, g_properties[idx].default_cstr_value); @@ -1100,7 +1100,7 @@ bool RunEnableCommand(CommandInterpreter &interpreter) { command_stream << "plugin structured-data darwin-log enable"; auto enable_options = GetGlobalProperties()->GetAutoEnableOptions(); - if (enable_options && (strlen(enable_options) > 0)) { + if (!enable_options.empty()) { command_stream << ' '; command_stream << enable_options; } -- cgit v1.2.3