From: Steinar H. Gunderson Date: Sun, 21 Oct 2007 12:38:57 +0000 (+0200) Subject: Pre-size one vector. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=4be9512cbccded915f224620c6e43dc6e1be53fd;p=foosball Pre-size one vector. --- diff --git a/foosrank.cpp b/foosrank.cpp index 25298e7..374bc13 100644 --- a/foosrank.cpp +++ b/foosrank.cpp @@ -360,6 +360,8 @@ static void compute_new_double_rating(double mu1, double sigma1, double mu2, dou compute_opponent_rating_pdf(score2, score1, mu_t, sigma_t, 1.0, curve); } + newcurve.reserve(curve.size()); + // iterate over r1 double h = 3000.0 / curve.size(); for (unsigned i = 0; i < curve.size(); ++i) {