[PATCH 3/3] score: Optimize _Objects_Name_to_id_u32()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Aug 21 08:32:38 UTC 2020


Remove the superfluous invalid name check since the object creation
directives ensure that objects with such a name cannot exist.  Also
finding an object with such a name would be no catastrophy if it really
exists.
---
 cpukit/score/src/objectnametoid.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/cpukit/score/src/objectnametoid.c b/cpukit/score/src/objectnametoid.c
index d89e161c8c..2a71c6e528 100644
--- a/cpukit/score/src/objectnametoid.c
+++ b/cpukit/score/src/objectnametoid.c
@@ -40,9 +40,6 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(
   if ( !id )
     return OBJECTS_INVALID_ADDRESS;
 
-  if ( name == 0 )
-    return OBJECTS_INVALID_NAME;
-
   maximum = _Objects_Get_maximum_index( information );
   search_local_node = false;
 
-- 
2.26.2



More information about the devel mailing list