Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
467e9548
Commit
467e9548
authored
7 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
gnrc_netreg: optimize gnrc_netreg_num() to use _netreg_lookup()
parent
dbda759b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/net/gnrc/netreg/gnrc_netreg.c
+3
-14
3 additions, 14 deletions
sys/net/gnrc/netreg/gnrc_netreg.c
with
3 additions
and
14 deletions
sys/net/gnrc/netreg/gnrc_netreg.c
+
3
−
14
View file @
467e9548
...
@@ -99,22 +99,11 @@ gnrc_netreg_entry_t *gnrc_netreg_lookup(gnrc_nettype_t type, uint32_t demux_ctx)
...
@@ -99,22 +99,11 @@ gnrc_netreg_entry_t *gnrc_netreg_lookup(gnrc_nettype_t type, uint32_t demux_ctx)
int
gnrc_netreg_num
(
gnrc_nettype_t
type
,
uint32_t
demux_ctx
)
int
gnrc_netreg_num
(
gnrc_nettype_t
type
,
uint32_t
demux_ctx
)
{
{
int
num
=
0
;
int
num
=
0
;
gnrc_netreg_entry_t
*
entry
;
gnrc_netreg_entry_t
*
entry
=
NULL
;
if
(
_INVALID_TYPE
(
type
))
{
while
((
entry
=
_netreg_lookup
(
entry
,
type
,
demux_ctx
))
!=
NULL
)
{
return
0
;
num
++
;
}
entry
=
netreg
[
type
];
while
(
entry
!=
NULL
)
{
if
(
entry
->
demux_ctx
==
demux_ctx
)
{
num
++
;
}
entry
=
entry
->
next
;
}
}
return
num
;
return
num
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment