[KDE/Mac] Review Request 128272: support -iframework and -F header search path options

René J.V. Bertin rjvbertin at gmail.com
Thu Jun 23 20:16:36 UTC 2016


On Thursday June 23 2016 20:28:08 Milian Wolff wrote:

> > Ah, right: *If the hash contains no item with the key, the function inserts
> > a default-constructed value into the hash with the key*. I don't recall
> > that the comparable stl classes work that way, but the documentation on the
> > "default-constructed values" also states that *For most value types, this
> > simply means that a value is created using the default constructor (e.g. an
> > empty string for QString).* I'll take your word on it that `ret` is not an
> > empty QString in this case.
> 
> It is an empty Path if the path was not yet encountered, otherwise the code below goes into 
> affect:
> 
>    if (ret.isEmpty() != path.isEmpty()) { 

Yes, it's evident that `path` is returned if `ret` is empty. What I find confusing is that an operator that is usually for read-out only (m_pathCache[path]) has a side-effect which apparently causes it to returns an empty string and then a copy of the input string itself when you call it again.

Somehow that's bit like redefining the == operator such that foo==bar first returns false, and then true because foo has been set to bar :)

R.


More information about the kde-mac mailing list