[PATCH] D22299: [include-fixer] Implement adding missing namespace qualifiers in vim integration.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 13 05:26:31 PDT 2016

hokein marked an inline comment as done.

Comment at: include-fixer/tool/ClangIncludeFixer.cpp:252
@@ +251,3 @@
+    // Only accept an unique header.
+    bool IsUniqueHeader =
+        std::adjacent_find(HeaderInfos.begin(), HeaderInfos.end(),
You are right. `adjancent_find` is not correct algorithm here. What I want to do is to check all elements' headers in `HeaderInfos` are equal. Change to `std::equal`, the same below.

Comment at: include-fixer/tool/clang-include-fixer.py:119
@@ +118,3 @@
+  header_infos = include_fixer_context["HeaderInfos"]
+  # Reduplicate headers, so that the same header would not be suggested twice.
+  headers = list(set([header_info["Header"] for header_info in header_infos]))
Should be `Deduplicate`.


More information about the cfe-commits mailing list