Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
de20da61
Commit
de20da61
authored
Mar 05, 2019
by
Libor Peltan
Committed by
Daniel Salzman
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zone: optimization of a frequently used function
parent
8ab0459c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
src/knot/zone/node.c
src/knot/zone/node.c
+3
-8
src/knot/zone/node.h
src/knot/zone/node.h
+2
-2
No files found.
src/knot/zone/node.c
View file @
de20da61
...
...
@@ -193,15 +193,10 @@ int binode_prepare_change(zone_node_t *node, knot_mm_t *mm)
zone_node_t
*
binode_node
(
zone_node_t
*
node
,
bool
second
)
{
if
(
node
!=
NULL
&&
(
node
->
flags
&
NODE_FLAGS_BINODE
))
{
if
(
second
&&
!
(
node
->
flags
&
NODE_FLAGS_SECOND
))
{
return
node
+
1
;
}
if
(
!
second
&&
(
node
->
flags
&
NODE_FLAGS_SECOND
))
{
return
node
-
1
;
}
if
(
unlikely
(
node
==
NULL
||
!
(
node
->
flags
&
NODE_FLAGS_BINODE
)))
{
return
node
;
}
return
node
;
return
node
+
(
second
-
(
int
)((
node
->
flags
&
NODE_FLAGS_SECOND
)
>>
9
))
;
}
bool
binode_rdata_shared
(
zone_node_t
*
node
,
uint16_t
type
)
...
...
src/knot/zone/node.h
View file @
de20da61
...
...
@@ -85,9 +85,9 @@ enum node_flags {
/*! \brief Node is the zone Apex. */
NODE_FLAGS_APEX
=
1
<<
6
,
/*! \brief Is this i bi-node? */
NODE_FLAGS_BINODE
=
1
<<
8
,
NODE_FLAGS_BINODE
=
1
<<
8
,
// this value shall be fixed
/*! \brief Is this the second half of bi-node? */
NODE_FLAGS_SECOND
=
1
<<
9
,
NODE_FLAGS_SECOND
=
1
<<
9
,
// this value shall be fixed
/*! \brief The node shall be deleted. It's just not because it's a bi-node and the counterpart still exists. */
NODE_FLAGS_DELETED
=
1
<<
10
,
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment