found a bug in uxn/patl/impl/assoc_generic.hpp

25 views
Skip to first unread message

ytakano

unread,
Jun 2, 2010, 10:19:17 AM6/2/10
to uxn_patl
Hi,

I found a bug in uxn/patl/impl/assoc_generic.hpp at line 79th:

76 word_t *get_shortcut(word_t a) const
77 {
78 const shortcuts_t::const_iterator it(shortcuts_.find(a));
79 return a == shortcuts_.end() ? 0 : it->second;
80 }

I think
79 return a == shortcuts_.end() ? 0 : it->second;
must be
79 return it == shortcuts_.end() ? 0 : it->second;
because "a" and "shortcuts_.end()" are incompatible types.

"a" is the type of word_t,
but
"shortcuts_.end()" is the type of std::map<word_t, word_t*>::iterator.
each type is obviously different.
Reply all
Reply to author
Forward
0 new messages