================
@@ -157,6 +162,23 @@ class CompletionRequest {
 
   size_t GetCursorIndex() const { return m_cursor_index; }
 
+  size_t GetMaxReturnElements() const { return m_max_return_elements; }
+
+  /// Returns true if the maximum number of completions has been reached
+  /// already.
+  bool ShouldStopAddingResults() const {
+    return m_result.GetNumberOfResults() >= m_max_return_elements;
+  }
----------------
JDevlieghere wrote:

I would consider inverting this to avoid the double negation in the for-loop.
```suggestion
  bool ShouldAddResult() const {
    return m_result.GetNumberOfResults() < m_max_return_elements;
  }
```

https://github.com/llvm/llvm-project/pull/135565
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to