[llvm] [llvm-strings] Use small buffer instead of reading whole file (PR #163073)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 01:24:23 PDT 2026


================

----------------
jh7370 wrote:

I'm finding this sentence difficult to follow. "no longer than MinSize" should that be "shorter than MinSize"? And which string is referred to with "part of the string"?

More generally, I think in this case it would be easier if there's a comment for each of the if/else/while sections of this block. Something like the following sketch:
```
// Comment explaining why InString || !Candidate.empty() is the interesting combination.
if (InString || !Candidate.empty()) {
  // Comment about the while loop
  while (...)
    ++Cur;
  ...
  if (InString) {
    // Comment for this specific branch explaining the situation and why doing what you are doing is the right thing.
  } else if (Candidate.size() + Len >= Min) {
    // Comment for this branch. Repeat for each other case.
  }
  ...

  if (Cur == End) {
    // Comment
    ...
  }
}
```

https://github.com/llvm/llvm-project/pull/163073


More information about the llvm-commits mailing list