> On Oct. 23, 2015, 6:45 p.m., Joseph Wu wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp, > > line 34 > > <https://reviews.apache.org/r/39559/diff/1/?file=1103501#file1103501line34> > > > > `strlen()` might be better/more-readable. > > Alex Clemmer wrote: > So, I could definitely be mistaken, but it looks like `strlen` would have > to be recomputed every time we call the function, right? And it looks like > this code is normally run at initialization time? > > If so it seems like this way has a clear benefit over the `strlen` > approach. What do you think? Maybe there is another way to make `strlen` an > init-time expression? (I already looked at `constexpr`.)
Post script: this exchange actually convinced me that we should compute the size of `alphabet` statically to! Let me know if you have a problem with this given the constraints I mentioned. :) > On Oct. 23, 2015, 6:45 p.m., Joseph Wu wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp, > > lines 36-41 > > <https://reviews.apache.org/r/39559/diff/1/?file=1103501#file1103501line36> > > > > The posix spec says that `XXXXXX` suffix is required, so > > `strings::endsWith` would be a better check. > > Alex Clemmer wrote: > Oh, good tip, I didn't know about that function. Thus turns out to have been a great suggestion. Simplified the code greatly, so thanks! - Alex ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39559/#review103815 ----------------------------------------------------------- On Oct. 27, 2015, 8:14 a.m., Alex Clemmer wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39559/ > ----------------------------------------------------------- > > (Updated Oct. 27, 2015, 8:14 a.m.) > > > Review request for mesos, Artem Harutyunyan, Joris Van Remoortere, and Joseph > Wu. > > > Repository: mesos > > > Description > ------- > > Windows: Implemented `os::mkdtemp`. > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/Makefile.am > ba2836a72ceee948cb43364e80ada9f132f33d04 > 3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp > 7f70c9ea7d57634b5bfd40523ba37561ec92a09a > 3rdparty/libprocess/3rdparty/stout/include/stout/os/mkdtemp.hpp > PRE-CREATION > 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/mkdtemp.hpp > PRE-CREATION > 3rdparty/libprocess/3rdparty/stout/include/stout/os/windows/mkdtemp.hpp > PRE-CREATION > 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp > b6afe0e76366d0bc68d37097ced83a1e14828d84 > 3rdparty/libprocess/3rdparty/stout/include/stout/windows/os.hpp > 3e6f2aafd0f541f512025dfa683ab4178701f7c4 > > Diff: https://reviews.apache.org/r/39559/diff/ > > > Testing > ------- > > > Thanks, > > Alex Clemmer > >
