Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3F1F195D2 for ; Mon, 21 Mar 2016 14:02:14 +0000 (UTC) Received: (qmail 59874 invoked by uid 500); 21 Mar 2016 14:02:14 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 59848 invoked by uid 500); 21 Mar 2016 14:02:14 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 59833 invoked by uid 99); 21 Mar 2016 14:02:14 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 14:02:14 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 6C94228B357; Mon, 21 Mar 2016 14:02:13 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4525377209752258999==" MIME-Version: 1.0 Subject: Re: Review Request 43561: Improve Ranges parsing to handle single values. From: Joris Van Remoortere To: Joris Van Remoortere , Ben Mahler , Alexander Rukletsov Cc: Klaus Ma , mesos Date: Mon, 21 Mar 2016 14:02:13 -0000 Message-ID: <20160321140213.19595.26251@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Joris Van Remoortere X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/43561/ X-Sender: Joris Van Remoortere References: <20160319100808.10325.11669@reviews.apache.org> In-Reply-To: <20160319100808.10325.11669@reviews.apache.org> Reply-To: Joris Van Remoortere X-ReviewRequest-Repository: mesos --===============4525377209752258999== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/43561/#review124545 ----------------------------------------------------------- src/common/values.cpp (line 612) Not yours: We shouldn't capture temporaries by reference. Either: 1) capture by value: `const vector tokens = ...` 2) iterator over the result: ``` foreach (const string& token, strings::tokenize(...)) { ``` I mention it because you copy the pattern below. src/common/values.cpp (lines 612 - 626) Should we add a benchmark here to understand the effect of now having 3 levels of `tokenize`? Is this code in any critical paths? src/common/values.cpp (line 613) @benm I wish we had support for iterating over these splicers eg: `foreachtoken(temp, ",\n", [](const string& token) { ... });` These helpers become rather heavy (at 3 nested) considering their utility. - Joris Van Remoortere On March 19, 2016, 10:08 a.m., Klaus Ma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/43561/ > ----------------------------------------------------------- > > (Updated March 19, 2016, 10:08 a.m.) > > > Review request for mesos, Alexander Rukletsov, Ben Mahler, and Joris Van Remoortere. > > > Bugs: MESOS-4627 > https://issues.apache.org/jira/browse/MESOS-4627 > > > Repository: mesos > > > Description > ------- > > Improve Ranges parsing to handle single values. > > > Diffs > ----- > > src/common/values.cpp 9f3c0b9930bd3dd9d84d97119419825862f531c3 > src/tests/resources_tests.cpp a545100522bf4b1f03e50656d461b3cda6b41e11 > src/tests/values_tests.cpp 929861549e3155c33966896f817f9bf9e6d14354 > > Diff: https://reviews.apache.org/r/43561/diff/ > > > Testing > ------- > > make > make check GTEST_FILTER=~"*" > ./src/mesos-test > > > Thanks, > > Klaus Ma > > --===============4525377209752258999==--