[patch] Refactor duplicated code into a helper function

Rafael Espíndola rafael.espindola@gmail.com
Wed Feb 4 20:02:00 GMT 2015


> Instead of doing that, though, I'd prefer folding the loop
> epilogue back into the loop -- the only difference is the computation
> of len, and we can handle that inside the loop:
>
>    while (p < pend)
>      {
>        const size_t len = p < pend0 ? string_length(p) : pend - p;
>        ...
>      }


Much better!
New patch attached

Thanks,
Rafael

2015-02-04  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
  * merge.cc (do_add_input_section): combine loop epilogue into main loop body.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 1042 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150204/b446404d/attachment.bin>


More information about the Binutils mailing list