# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1421680822 18000 # Node ID 6c264f2053bcadc80b4a8d2e7daa6a01c5140596 # Parent f9d59c356eb06baf30a111ae3e7c20237f2de8b6 jmedcouple: use std::tie and std::move for tuple unpacking diff --git a/jmedcouple.c++ b/jmedcouple.c++ --- 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)