Mercurial > hg > medcouple
changeset 35:6c264f2053bc
jmedcouple: use std::tie and std::move for tuple unpacking
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 19 Jan 2015 10:20:22 -0500 |
parents | f9d59c356eb0 |
children | f61da46ca3e6 |
files | jmedcouple.c++ |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/jmedcouple.c++ +++ b/jmedcouple.c++ @@ -46,11 +46,14 @@ long wleft = 0, wright = 0; for (aw_t& aw: AW ) { - if (aw.first > trial) - wleft += aw.second; + double a; + long w; + tie(a, w) = move(aw); + if (a > trial) + wleft += w; else // This also includes a == trial, i.e. the "middle" weight. - wright += aw.second; + wright += w; } if (2*wleft > wtot)