Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc-2-2
Commits
1c707713
Commit
1c707713
authored
Nov 24, 2011
by
Hugo Beauzée-Luyssen
Committed by
Rémi Denis-Courmont
Nov 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: DOMHelper: Avoiding some copies, using operator== instead of compare()
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
d6576e6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
modules/stream_filter/dash/xml/DOMHelper.cpp
modules/stream_filter/dash/xml/DOMHelper.cpp
+5
-5
modules/stream_filter/dash/xml/DOMHelper.h
modules/stream_filter/dash/xml/DOMHelper.h
+3
-3
No files found.
modules/stream_filter/dash/xml/DOMHelper.cpp
View file @
1c707713
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
using
namespace
dash
::
xml
;
using
namespace
dash
::
xml
;
std
::
vector
<
Node
*>
DOMHelper
::
getElementByTagName
(
Node
*
root
,
std
::
string
name
,
bool
selfContain
)
std
::
vector
<
Node
*>
DOMHelper
::
getElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
bool
selfContain
)
{
{
std
::
vector
<
Node
*>
elements
;
std
::
vector
<
Node
*>
elements
;
...
@@ -41,20 +41,20 @@ std::vector<Node *> DOMHelper::getElementByTagName (Node *root, std::string
...
@@ -41,20 +41,20 @@ std::vector<Node *> DOMHelper::getElementByTagName (Node *root, std::string
return
elements
;
return
elements
;
}
}
std
::
vector
<
Node
*>
DOMHelper
::
getChildElementByTagName
(
Node
*
root
,
std
::
string
name
)
std
::
vector
<
Node
*>
DOMHelper
::
getChildElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
)
{
{
std
::
vector
<
Node
*>
elements
;
std
::
vector
<
Node
*>
elements
;
for
(
size_t
i
=
0
;
i
<
root
->
getSubNodes
().
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
root
->
getSubNodes
().
size
();
i
++
)
{
{
if
(
!
root
->
getSubNodes
().
at
(
i
)
->
getName
().
compare
(
name
)
)
if
(
root
->
getSubNodes
().
at
(
i
)
->
getName
()
==
name
)
elements
.
push_back
(
root
->
getSubNodes
().
at
(
i
));
elements
.
push_back
(
root
->
getSubNodes
().
at
(
i
));
}
}
return
elements
;
return
elements
;
}
}
void
DOMHelper
::
getElementsByTagName
(
Node
*
root
,
std
::
string
name
,
std
::
vector
<
Node
*>
*
elements
,
bool
selfContain
)
void
DOMHelper
::
getElementsByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
std
::
vector
<
Node
*>
*
elements
,
bool
selfContain
)
{
{
if
(
!
selfContain
&&
!
root
->
getName
().
compare
(
name
))
if
(
!
selfContain
&&
!
root
->
getName
().
compare
(
name
))
{
{
...
@@ -75,7 +75,7 @@ Node* DOMHelper::getFirstChildElementByName( Node *root, const std::st
...
@@ -75,7 +75,7 @@ Node* DOMHelper::getFirstChildElementByName( Node *root, const std::st
{
{
for
(
size_t
i
=
0
;
i
<
root
->
getSubNodes
().
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
root
->
getSubNodes
().
size
();
i
++
)
{
{
if
(
!
root
->
getSubNodes
().
at
(
i
)
->
getName
().
compare
(
name
)
)
if
(
root
->
getSubNodes
().
at
(
i
)
->
getName
()
==
name
)
return
root
->
getSubNodes
().
at
(
i
);
return
root
->
getSubNodes
().
at
(
i
);
}
}
return
NULL
;
return
NULL
;
...
...
modules/stream_filter/dash/xml/DOMHelper.h
View file @
1c707713
...
@@ -37,12 +37,12 @@ namespace dash
...
@@ -37,12 +37,12 @@ namespace dash
class
DOMHelper
class
DOMHelper
{
{
public:
public:
static
std
::
vector
<
Node
*>
getElementByTagName
(
Node
*
root
,
std
::
string
name
,
bool
selfContain
);
static
std
::
vector
<
Node
*>
getElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
bool
selfContain
);
static
std
::
vector
<
Node
*>
getChildElementByTagName
(
Node
*
root
,
std
::
string
name
);
static
std
::
vector
<
Node
*>
getChildElementByTagName
(
Node
*
root
,
const
std
::
string
&
name
);
static
Node
*
getFirstChildElementByName
(
Node
*
root
,
const
std
::
string
&
name
);
static
Node
*
getFirstChildElementByName
(
Node
*
root
,
const
std
::
string
&
name
);
private:
private:
static
void
getElementsByTagName
(
Node
*
root
,
std
::
string
name
,
std
::
vector
<
Node
*>
*
elements
,
bool
selfContain
);
static
void
getElementsByTagName
(
Node
*
root
,
const
std
::
string
&
name
,
std
::
vector
<
Node
*>
*
elements
,
bool
selfContain
);
};
};
}
}
}
}
...
...
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