diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-25 20:15:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:02 +0100 |
commit | 1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98 (patch) | |
tree | ff95b47443c47377f1e9bcb7790cffb4b6e59bb0 /cpukit/score/src/objectnametoidstring.c | |
parent | score: Optimize object lookup (diff) | |
download | rtems-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/objectnametoidstring.c')
-rw-r--r-- | cpukit/score/src/objectnametoidstring.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/score/src/objectnametoidstring.c b/cpukit/score/src/objectnametoidstring.c index a015d5fc25..d357339ea7 100644 --- a/cpukit/score/src/objectnametoidstring.c +++ b/cpukit/score/src/objectnametoidstring.c @@ -29,9 +29,10 @@ Objects_Control *_Objects_Get_by_name( Objects_Get_by_name_error *error ) { - size_t name_length; - size_t max_name_length; - uint32_t index; + size_t name_length; + size_t max_name_length; + Objects_Maximum maximum; + Objects_Maximum index; _Assert( _Objects_Has_string_name( information ) ); _Assert( _Objects_Allocator_is_owner() ); @@ -52,7 +53,9 @@ Objects_Control *_Objects_Get_by_name( *name_length_p = name_length; } - for ( index = 0; index < information->maximum; ++index ) { + maximum = _Objects_Get_maximum_index( information ); + + for ( index = 0; index < maximum; ++index ) { Objects_Control *the_object; the_object = information->local_table[ index ]; |