Re: [PATCH] Refactoring: use std::swap instead of manual swaps (part 2)

2015-06-21 Thread Mikhail Maltsev
On 16.06.2015 9:09, Uros Bizjak wrote: > According to [1], patches that convert to std::swap are considered as > obvious and don't need approval. If there is a non-trivial part, > please split it to a separate patch for an eventual discussion. > > [1] https://gcc.gnu.org/ml/gcc-patches/2015-04/msg

Re: [PATCH] Refactoring: use std::swap instead of manual swaps (part 2)

2015-06-15 Thread Uros Bizjak
Hello! > The attached patch replaces manual swaps (i.e. "tmp = a; a = b; b = > tmp;") with std::swap. It also removes a couple of static functions > which were used only for implementing such swaps. > > Bootstrapped/regtested on x86_64-linux; full target list build in > progress. OK for trunk? Ac

[PATCH] Refactoring: use std::swap instead of manual swaps (part 2)

2015-06-14 Thread Mikhail Maltsev
Hi all. The attached patch replaces manual swaps (i.e. "tmp = a; a = b; b = tmp;") with std::swap. It also removes a couple of static functions which were used only for implementing such swaps. Bootstrapped/regtested on x86_64-linux; full target list build in progress. OK for trunk? -- Regards,

Re: [PATCH] Refactoring: use std::swap instead of manual swaps

2015-05-18 Thread Mikhail Maltsev
On 19.05.2015 0:39, Jeff Law wrote: > Did you mean to lose the assignment to heapa->m_nodes in fibonacci_heap.h? > > I just spot-checked and it looks fine to me, except for perhaps losing > the assignment noted above. > > jeff Oops. Fixed that and committed to trunk (just in case, I re-ran tests

Re: [PATCH] Refactoring: use std::swap instead of manual swaps

2015-05-18 Thread Jeff Law
On 05/18/2015 12:07 PM, Mikhail Maltsev wrote: Hi all. The attached patch replaces the following typical sequence of assignments, matching the pattern: [type] = ; = ; = ; with std::swap (, ); The goal is to improve code readability (at least a little). Pattern was searched in GCC tree usi

Re: [PATCH] Refactoring: use std::swap instead of manual swaps

2015-05-18 Thread Trevor Saunders
On Mon, May 18, 2015 at 09:07:43PM +0300, Mikhail Maltsev wrote: > Hi all. > The attached patch replaces the following typical sequence of > assignments, matching the pattern: > > [type] = ; > = ; > = ; > > with > > std::swap (, ); I believe that transformation is considered obvious, so you

[PATCH] Refactoring: use std::swap instead of manual swaps

2015-05-18 Thread Mikhail Maltsev
Hi all. The attached patch replaces the following typical sequence of assignments, matching the pattern: [type] = ; = ; = ; with std::swap (, ); The goal is to improve code readability (at least a little). Pattern was searched in GCC tree using a script, but all modifications have been done