[Xorp-cvs] XORP cvs commit: xorp/bgp

Pavlin Radoslavov pavlin at icir.org
Fri Aug 3 14:47:35 PDT 2007


CVSROOT:	/usr/local/share/doc/apache/cvs
Module name:	xorp
Changes by:	pavlin at xorpc.icir.org	2007-08-03 21:47:35 UTC

XORP CVS repository


Modified files:
	bgp           peer_list.cc 

Log message:
	Bug fix with the previous commit.
	
	In the previous commit there was replacement of:
	OLD:
	  my_map[key] = value;
	NEW:
	  my_map.insert(make_pair(key, value));
	
	However, those operations are NOT equivalent.
	In the second operation the insert will fail if there was already
	an entry with same key (i.e., the value is not overwritten).
	In the first operation the value will always be installed, eventually
	overwritting any old values.
	
	After the fix, we call my_map.erase(key) before calling
	my_map.insert(...)
	
	Note that we avoid calling the obvious "my_map[key] = value", because
	in this particular case "value" has a little bit odd type:
	it is an STL iterator, and MacOS X 10.4.10 with gcc-4.0.0
	compiled with -O2 doesn't like it.

Revision  Changes                               Path
1.26      +7 -3;  commitid: 1010f46b3a0ca7ea6;  xorp/bgp/peer_list.cc



More information about the Xorp-cvs mailing list