sgraenitz added inline comments.
================ Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:337 + if (llvm::StringRef(First, Last - First).startswith(Search)) { + Result += llvm::StringRef(Written, First - Written); + Result += Replace; ---------------- shafik wrote: > also `First - Written` is used twice but it is not obvious what the means, > naming it via a member function might be helpful. `First` points to the first char of the input (`Mangled`). `Written` points to the char of the input, up until we have constructed the respective output already. Quite similar to the previous implementation. Difference is: it used a `std::back_insert_iterator`, but I wouldn't say that made it simpler. Intelligibility may benefit from comment as in the past: ``` // Write the unmatched part of the original. Then write the // replacement string. Finally skip the search string in the original. ``` IMHO it's not a high prio. https://reviews.llvm.org/D54074 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits