5% cpu optimization
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 19 Nov 2008 14:19:10 +0100
changeset 3870 a77d35844233
parent 3869 0edba1e055aa
child 3871 c6f693de286d
5% cpu optimization
src/core/type-id.cc
src/core/type-id.h
--- a/src/core/type-id.cc	Tue Nov 18 23:14:02 2008 +0100
+++ b/src/core/type-id.cc	Wed Nov 19 14:19:10 2008 +0100
@@ -365,10 +365,6 @@
  *         The TypeId class
  *********************************************************************/
 
-TypeId::TypeId ()
-  : m_tid (0)
-{}
-
 TypeId::TypeId (const char *name)
 {
   uint16_t uid = Singleton<IidManager>::Get ()->AllocateUid (name);
@@ -380,8 +376,6 @@
 TypeId::TypeId (uint16_t tid)
   : m_tid (tid)
 {}
-TypeId::~TypeId ()
-{}
 TypeId 
 TypeId::LookupByName (std::string name)
 {
--- a/src/core/type-id.h	Tue Nov 18 23:14:02 2008 +0100
+++ b/src/core/type-id.h	Wed Nov 19 14:19:10 2008 +0100
@@ -351,8 +351,10 @@
   void SetUid (uint16_t tid);
 
   // construct an invalid TypeId.
-  TypeId ();
-  ~TypeId ();
+  inline TypeId ();
+  inline TypeId (const TypeId &o);
+  inline TypeId &operator = (const TypeId &o);
+  inline ~TypeId ();
 
 private:
   friend class AttributeList;
@@ -393,6 +395,19 @@
 
 namespace ns3 {
 
+TypeId::TypeId ()
+  : m_tid (0) {}
+TypeId::TypeId (const TypeId &o)
+  : m_tid (o.m_tid) {}
+TypeId &TypeId::operator = (const TypeId &o)
+{
+  m_tid = o.m_tid;
+  return *this;
+}
+TypeId::~TypeId ()
+{}
+
+
 /*************************************************************************
  *   The TypeId implementation which depends on templates
  *************************************************************************/