Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
mhwd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
Applications
mhwd
Commits
6f155539
Commit
6f155539
authored
Jun 27, 2015
by
Łukasz Matysiak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove comments. Use range-based for loops
parent
9f0b7b2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
27 deletions
+21
-27
src/Data.cpp
src/Data.cpp
+20
-26
src/Data.hpp
src/Data.hpp
+1
-1
No files found.
src/Data.cpp
View file @
6f155539
...
...
@@ -194,7 +194,6 @@ std::vector<std::shared_ptr<Config>> Data::getAllDependenciesToInstall(
std
::
vector
<
std
::
shared_ptr
<
Config
>>
depends
;
std
::
vector
<
std
::
shared_ptr
<
Config
>>
installedConfigs
;
// Get the right configs
if
(
"USB"
==
config
->
type_
)
{
installedConfigs
=
installedUSBConfigs
;
...
...
@@ -204,7 +203,6 @@ std::vector<std::shared_ptr<Config>> Data::getAllDependenciesToInstall(
installedConfigs
=
installedPCIConfigs
;
}
// Get all depends
getAllDependenciesToInstall
(
config
,
installedConfigs
,
&
depends
);
return
depends
;
...
...
@@ -249,7 +247,6 @@ std::shared_ptr<Config> Data::getDatabaseConfig(const std::string configName,
{
std
::
vector
<
std
::
shared_ptr
<
Config
>>
allConfigs
;
// Get the right configs
if
(
"USB"
==
configType
)
{
allConfigs
=
allUSBConfigs
;
...
...
@@ -259,12 +256,13 @@ std::shared_ptr<Config> Data::getDatabaseConfig(const std::string configName,
allConfigs
=
allPCIConfigs
;
}
for
(
auto
&&
config
=
allConfigs
.
begin
();
config
!=
allConfigs
.
end
();
++
config
)
for
(
auto
&
config
:
allConfigs
)
{
if
(
configName
==
(
*
config
)
->
name_
)
if
(
configName
==
config
->
name_
)
{
return
(
*
config
);
return
config
;
}
}
...
...
@@ -277,7 +275,6 @@ std::vector<std::shared_ptr<Config>> Data::getAllLocalConflicts(std::shared_ptr<
std
::
vector
<
std
::
shared_ptr
<
Config
>>
dependencies
=
getAllDependenciesToInstall
(
config
);
std
::
vector
<
std
::
shared_ptr
<
Config
>>
installedConfigs
;
// Get the right configs
if
(
"USB"
==
config
->
type_
)
{
installedConfigs
=
installedUSBConfigs
;
...
...
@@ -330,7 +327,6 @@ std::vector<std::shared_ptr<Config>> Data::getAllLocalRequirements(std::shared_p
std
::
vector
<
std
::
shared_ptr
<
Config
>>
requirements
;
std
::
vector
<
std
::
shared_ptr
<
Config
>>
installedConfigs
;
// Get the right configs
if
(
"USB"
==
config
->
type_
)
{
installedConfigs
=
installedUSBConfigs
;
...
...
@@ -566,28 +562,26 @@ void Data::setMatchingConfig(std::shared_ptr<Config> config,
}
void
Data
::
addConfigSorted
(
std
::
vector
<
std
::
shared_ptr
<
Config
>>&
configs
,
std
::
shared_ptr
<
Config
>
c
onfig
)
std
::
shared_ptr
<
Config
>
newC
onfig
)
{
for
(
auto
&&
iterator
=
configs
.
begin
();
iterator
!=
configs
.
end
();
iterator
++
)
{
if
(
config
->
name_
==
(
*
iterator
)
->
name_
)
{
return
;
}
}
for
(
auto
&&
iterator
=
configs
.
begin
();
iterator
!=
configs
.
end
();
iterator
++
)
bool
found
=
std
::
find_if
(
configs
.
begin
(),
configs
.
end
(),
[
&
newConfig
](
const
std
::
shared_ptr
<
Config
>&
config
)
{
return
newConfig
->
name_
==
config
->
name_
;
})
!=
configs
.
end
();
if
(
!
found
)
{
if
(
config
->
priority_
>
(
*
iterator
)
->
priority_
)
for
(
auto
&&
config
=
configs
.
begin
();
config
!=
configs
.
end
();
config
++
)
{
configs
.
insert
(
iterator
,
std
::
shared_ptr
<
Config
>
(
config
));
return
;
if
(
newConfig
->
priority_
>
(
*
config
)
->
priority_
)
{
configs
.
insert
(
config
,
std
::
shared_ptr
<
Config
>
(
newConfig
));
return
;
}
}
configs
.
emplace_back
(
newConfig
);
}
configs
.
emplace_back
(
config
);
}
Vita
::
string
Data
::
from_Hex
(
std
::
uint16_t
hexnum
,
int
fill
)
...
...
src/Data.hpp
View file @
6f155539
...
...
@@ -83,7 +83,7 @@ private:
std
::
vector
<
std
::
shared_ptr
<
Config
>>&
configs
,
bool
setAsInstalled
);
void
setMatchingConfig
(
std
::
shared_ptr
<
Config
>
config
,
const
std
::
vector
<
std
::
shared_ptr
<
Device
>>&
devices
,
bool
setAsInstalled
);
void
addConfigSorted
(
std
::
vector
<
std
::
shared_ptr
<
Config
>>&
configs
,
std
::
shared_ptr
<
Config
>
c
onfig
);
void
addConfigSorted
(
std
::
vector
<
std
::
shared_ptr
<
Config
>>&
configs
,
std
::
shared_ptr
<
Config
>
newC
onfig
);
std
::
vector
<
std
::
string
>
getRecursiveDirectoryFileList
(
const
std
::
string
&
directoryPath
,
std
::
string
onlyFilename
=
""
);
...
...
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