Skip to content

Commit

Permalink
Properly use multimap for lookup in poly casting
Browse files Browse the repository at this point in the history
relates USCiLab#356, still need final testing on MSVC
  • Loading branch information
AzothAmmo committed Feb 12, 2017
1 parent a917374 commit 2590f21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/cereal/details/polymorphic_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,12 @@ namespace cereal

// Check to see if we have a previous uncommitted path in unregisteredRelations
// that is shorter. If so, ignore this path
auto hint = unregisteredRelations.find( parent );
auto hintRange = unregisteredRelations.equal_range( parent );
auto hint = hintRange.first;
for( ; hint != hintRange.second; ++hint )
if( hint->second.first == finalChild )
break;

const bool uncommittedExists = hint != unregisteredRelations.end();
if( uncommittedExists && (hint->second.second.size() <= newLength) )
continue;
Expand Down

0 comments on commit 2590f21

Please sign in to comment.