> On April 9, 2014, 10:57 p.m., Ben Mahler wrote: > > src/state/log.cpp, line 455 > > <https://reviews.apache.org/r/19007/diff/1-2/?file=515951#file515951line455> > > > > Alternatively, since you've already ensured the entry is present: > > > > const Snapshot& snapshot = snapshots[entry.name()]; > > > > But I suppose it would be good to be prudent and avoid the non-const > > map operation. We could also pull out the Option<Snapshot>: > > > > Option<Snapshot> snapshot = snapshots.get(entry.name()); > > > > if (snapshot.isNone()) { > > return false; > > } > > ... > > > > The .get(...).get() pattern seems a bit unfortunate in general.
I cant use the [] operator because Snapshot is not default constructible. Great suggestion to use Option<Snapshot>, I've updated all 'get' calls to this pattern instead. Thanks Ben! - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19007/#review39958 ----------------------------------------------------------- On March 31, 2014, 7:11 a.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19007/ > ----------------------------------------------------------- > > (Updated March 31, 2014, 7:11 a.m.) > > > Review request for mesos, Ben Mahler and Jie Yu. > > > Repository: mesos-git > > > Description > ------- > > This is a combination of both https://reviews.apache.org/r/17423 and > https://reviews.apache.org/r/17424 which have been merged to make it easier > to make changes. > > > Diffs > ----- > > src/Makefile.am 47d03b393f68ebd4e9eba3206798a939078023c0 > src/messages/state.proto 7f7a8a505d6f24b01fec0c3ad47b0e15b2b17ffa > src/state/log.hpp PRE-CREATION > src/state/log.cpp PRE-CREATION > src/tests/state_tests.cpp d0e084070c566ee7d751a8e1279772e05b966145 > > Diff: https://reviews.apache.org/r/19007/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Hindman > >
