=?utf-8?q?José?= L. Junior <josejun...@10xengineers.ai>,taalhaataahir0102 <23100...@lums.edu.pk>,taalhaataahir0102 <23100...@lums.edu.pk>,taalhaataahir0102 <23100...@lums.edu.pk>,taalhaataahir0102 <23100...@lums.edu.pk>, =?utf-8?q?José?= L. Junior <josejun...@10xengineers.ai>, =?utf-8?q?José?= L. Junior <josejun...@10xengineers.ai>, =?utf-8?q?José?= L. Junior <josejun...@10xengineers.ai> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/69...@github.com>
DavidSpickett wrote: > Is it better if I declared llvm::StringRef ansi_prefix and llvm::StringRef > ansi_suffix outside the conditions even if they are not used? As far as I can tell, that's how you must do it, or at least, one of the simpler ways. You could do: ``` s->PutCStringColorHighlighted(symbol->GetName().GetStringRef(), pattern, target_sp ? target_sp->GetDebugger().GetRegexMatchAnsiPrefix() : "", target_sp ? target_sp->GetDebugger().GetRegexMatchAnsiSuffix() : ""); ``` If you prefer. There's not much difference to it. One puts it all in a single call which is good because the scope of the values is limited. The other has 1 conditional instead of two. Leave it as is. Sounds like you will end up refactoring it anyway. https://github.com/llvm/llvm-project/pull/69422 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits