[lld] r277043 - [ELF] - Cosmetic change. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 15:13:23 PDT 2016


On Thu, Jul 28, 2016 at 3:01 PM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Thu Jul 28 17:01:56 2016
> New Revision: 277043
>
> URL: http://llvm.org/viewvc/llvm-project?rev=277043&view=rev
> Log:
> [ELF] - Cosmetic change. NFC.
>
> peek()[0] == '*' changed to peek().startswith("*")
>

It's actually more than that. You can now remove `!peek().empty()` check.


> Modified:
>     lld/trunk/ELF/LinkerScript.cpp
>
> Modified: lld/trunk/ELF/LinkerScript.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=277043&r1=277042&r2=277043&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/LinkerScript.cpp (original)
> +++ lld/trunk/ELF/LinkerScript.cpp Thu Jul 28 17:01:56 2016
> @@ -747,7 +747,7 @@ void ScriptParser::readOutputSectionDesc
>    expect("{");
>
>    while (!Error && !skip("}")) {
> -    if ((!peek().empty() && peek()[0] == '*') || peek() == "KEEP") {
> +    if ((!peek().empty() && peek().startswith("*")) || peek() == "KEEP") {
>        Cmd->Commands.push_back(readInputSectionDescription());
>        continue;
>      }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160728/a8733a8d/attachment.html>


More information about the llvm-commits mailing list