# HG changeset patch # User Wilson Thong # Date 1246802834 -28800 # Node ID 3e68c57cb4c07be0b3f03233b9ffa9f51b53a4da # Parent 175e54086c671e53d407fef89d5e20500777b0f6 imported patch const-remove-tag.patch The method of removing tag from packet is now a const operation. diff -r 175e54086c67 -r 3e68c57cb4c0 src/common/packet.cc --- a/src/common/packet.cc Sun Jul 05 22:16:08 2009 +0800 +++ b/src/common/packet.cc Sun Jul 05 22:07:14 2009 +0800 @@ -629,10 +629,10 @@ m_packetTagList.Add (tag); } bool -Packet::RemovePacketTag (Tag &tag) +Packet::RemovePacketTag (Tag &tag) const { NS_LOG_FUNCTION (this << tag.GetInstanceTypeId ().GetName () << tag.GetSerializedSize ()); - bool found = m_packetTagList.Remove (tag); + bool found = const_cast(&m_packetTagList)->Remove (tag); return found; } bool diff -r 175e54086c67 -r 3e68c57cb4c0 src/common/packet.h --- a/src/common/packet.h Sun Jul 05 22:16:08 2009 +0800 +++ b/src/common/packet.h Sun Jul 05 22:07:14 2009 +0800 @@ -490,7 +490,7 @@ * Remove a tag from this packet. This method calls * Tag::Deserialize if the tag is found. */ - bool RemovePacketTag (Tag &tag); + bool RemovePacketTag (Tag &tag) const; /** * \param tag the tag to search in this packet * \returns true if the requested tag is found, false