> On June 6, 2013, 9:46 p.m., Ben Mahler wrote: > > third_party/libprocess/third_party/stout/include/stout/duration.hpp, lines > > 268-281 > > <https://reviews.apache.org/r/11331/diff/1/?file=295514#file295514line268> > > > > Well.. depends how one defines elegance, I had a hard time following > > this logic ;) > > > > For example, this code has the following nests: > > for { > > if { > > if { > > if { > > } > > } > > break; > > } > > } > > and I need to understand the buckets, the sentinels, how the mappings > > work, etc. > > > > That is, it's hard for me to quickly look at this code and determine > > it's correctness.
Sorry this has been on the back burner for a while. I revised the logic to be more straightforward but with more lines of code. I found it hard to use the modulo operator for reasons such as: the methods that get numbers out of the duration return doubles. Does this read better? - Jiang Yan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/#review21541 ----------------------------------------------------------- On May 22, 2013, 7:08 p.m., Jiang Yan Xu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/11331/ > ----------------------------------------------------------- > > (Updated May 22, 2013, 7:08 p.m.) > > > Review request for mesos, Benjamin Hindman and Vinod Kone. > > > Bugs: MESOS-477 > https://issues.apache.org/jira/browse/MESOS-477 > > > Repository: mesos > > > Description > ------- > > - Currently when the result isn't a whole number, we go one-level down in > terms of the unit of time and see if we can get a whole number there. If so, > use the lower unit; if not, use the higher unit. > > > Diffs > ----- > > third_party/libprocess/third_party/stout/include/stout/duration.hpp > c943ab196871cf4c55f2a2dce5ef85ffe3a22577 > third_party/libprocess/third_party/stout/tests/duration_tests.cpp > 421615aa510f540ccfc0413d3252bbdedd70f7da > > Diff: https://reviews.apache.org/r/11331/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jiang Yan Xu > >
