Update of patch #849 (project wesnoth):

                  Status:                    None => Wont Do                
             Assigned to:                    None => alink                  

    _______________________________________________________

Follow-up Comment #1:

Agreed, this code can probably be improved.
But your patch seems to do a:
  itor = labels_.end()->second.end();
which seems not very more clean. IIRC this is what I tried to avoid when
bug-fixing this function.

Do I miss something because your other last patch in builder.cpp was to
prevent such operations ?

And i am curious, is it some compiler warning? It seems that a human can
guess (but maybe not directly) that both tests on itor
  (label_map == labels_.end() || itor == label_map->second.end())
  (label_map != labels_.end() && itor != label_map->second.end())
are done only after a
  if (label_map != labels_.end())
    itor = label_map->second.find(loc);
And thus the test are always only done on an initialized itor. I suppose that
it can confuse a compiler.
Of course this also use the c++ rule of short-circuit evaluation (
http://en.wikipedia.org/wiki/Short-circuit_evaluation )
Agreed not obvious and the "&&" version is more clear. I guess it means that
i again written not readable code, I will try to simplify it.



    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?849>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to