summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectnametoid.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-25 20:15:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-07 14:22:02 +0100
commit1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98 (patch)
treeff95b47443c47377f1e9bcb7790cffb4b6e59bb0 /cpukit/score/src/objectnametoid.c
parentscore: Optimize object lookup (diff)
downloadrtems-1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98.tar.bz2
score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id. Add and use _Objects_Get_maximum_index(). Update #3621.
Diffstat (limited to 'cpukit/score/src/objectnametoid.c')
-rw-r--r--cpukit/score/src/objectnametoid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/score/src/objectnametoid.c b/cpukit/score/src/objectnametoid.c
index c3b014e3e1..6a89b874e7 100644
--- a/cpukit/score/src/objectnametoid.c
+++ b/cpukit/score/src/objectnametoid.c
@@ -29,6 +29,7 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(
{
bool search_local_node;
Objects_Control *the_object;
+ Objects_Maximum maximum;
Objects_Maximum index;
#if defined(RTEMS_MULTIPROCESSING)
Objects_Name name_for_mp;
@@ -42,9 +43,10 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(
if ( name == 0 )
return OBJECTS_INVALID_NAME;
+ maximum = _Objects_Get_maximum_index( information );
search_local_node = false;
- if ( information->maximum != 0 &&
+ if ( maximum > 0 &&
(node == OBJECTS_SEARCH_ALL_NODES ||
node == OBJECTS_SEARCH_LOCAL_NODE ||
_Objects_Is_local_node( node )
@@ -52,7 +54,7 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(
search_local_node = true;
if ( search_local_node ) {
- for ( index = 0; index < information->maximum; ++index ) {
+ for ( index = 0; index < maximum; ++index ) {
the_object = information->local_table[ index ];
if ( !the_object )
continue;