[PATCH] D36201: Merge manifest namespaces.

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 14:43:28 PDT 2017


zturner added inline comments.


================
Comment at: llvm/lib/WindowsManifest/WindowsManifestMerger.cpp:584-585
+    if (Def->prefix &&
+        (std::find(RequiredPrefixes.begin(), RequiredPrefixes.end(), Def) ==
+         RequiredPrefixes.end())) {
+      if (Def == Node->nsDef)
----------------
zturner wrote:
> `!llvm::is_contained(RequiredPrefixes, Def)` will allow you to get this all on a single line.  Similar applies to other places in the file.
Also, invert the conditional first and then put a `continue`.

```
if (!Def->prefix || llvm::is_contained(RequiredPrefixes, Def)) {
  Prev = Def;
  continue;
}

...
```

This keeps the indentation down and makes it easier to read.


https://reviews.llvm.org/D36201





More information about the llvm-commits mailing list