> On May 18, 2018, 4:57 p.m., Jie Yu wrote:
> > 3rdparty/stout/include/stout/path.hpp
> > Lines 87 (patched)
> > <https://reviews.apache.org/r/65811/diff/5/?file=2024592#file2024592line87>
> >
> >     I small nits, i'd suggest the following to make the logic a bit easier 
> > to understand:
> >     ```
> >     if (component != "..") {
> >       components.push_back(component);
> >     } else {
> >       if (isEmpty && !isAbs) {
> >         components.push_back(component);
> >       } else if (!isEmpty && components.back() == "..") {
> >         components.push_back(component);
> >       } else if (!isEmpty) {
> >         components.pop_back();
> >       }
> >     }
> >     ```

I was originally using something similar to this. I think the current version 
should be fine, as the comment should explain it. I also just reference-checked 
[Python's implementation of 
`os.path.normpath`](https://github.com/python/cpython/blob/2.7/Lib/posixpath.py#L346-L347),
 it does things exactly the same way.


- Jason


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65811/#review203392
-----------------------------------------------------------


On May 17, 2018, 1:06 a.m., Jason Lai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65811/
> -----------------------------------------------------------
> 
> (Updated May 17, 2018, 1:06 a.m.)
> 
> 
> Review request for mesos, Anish Gupta, Eric Chung, Gilbert Song, Jie Yu, 
> James Peach, and Zhitao Li.
> 
> 
> Bugs: MESOS-8257
>     https://issues.apache.org/jira/browse/MESOS-8257
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add `path::normalize` to stout for normalizing path (for POSIX only now).
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/path.hpp 
> 27438d31617b3b78bf3d4deffd25c93340610e8d 
> 
> 
> Diff: https://reviews.apache.org/r/65811/diff/5/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Jason Lai
> 
>

Reply via email to