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
d5a9fdd0
Commit
d5a9fdd0
authored
Jun 27, 2015
by
Łukasz Matysiak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style. Use range based for loops and std::find_if
parent
6f155539
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
src/Data.cpp
src/Data.cpp
+15
-22
No files found.
src/Data.cpp
View file @
d5a9fdd0
...
...
@@ -44,16 +44,15 @@ Data::Data()
void
Data
::
updateInstalledConfigData
()
{
// Clear config vectors in each device element
for
(
auto
&&
PCIDevice
=
PCIDevices
.
begin
();
PCIDevice
!=
PCIDevices
.
end
();
++
PCIDevice
)
for
(
auto
&
PCIDevice
:
PCIDevices
)
{
(
*
PCIDevice
)
->
installedConfigs_
.
clear
();
PCIDevice
->
installedConfigs_
.
clear
();
}
for
(
auto
&&
USBDevice
=
USBDevices
.
begin
();
USBDevice
!=
USBDevices
.
end
();
++
USBDevice
)
for
(
auto
&
USBDevice
:
USBDevices
)
{
(
*
USBDevice
)
->
installedConfigs_
.
clear
();
USBDevice
->
installedConfigs_
.
clear
();
}
installedPCIConfigs
.
clear
();
...
...
@@ -83,12 +82,11 @@ void Data::fillInstalledConfigs(std::string type)
configPaths
=
getRecursiveDirectoryFileList
(
MHWD_PCI_DATABASE_DIR
,
MHWD_CONFIG_NAME
);
}
for
(
auto
&&
configPath
=
configPaths
.
begin
();
configPath
!=
configPaths
.
end
();
++
configPath
)
for
(
const
auto
&
configPath
:
configPaths
)
{
Config
*
config
=
new
Config
(
(
*
configPath
)
,
type
);
Config
*
config
=
new
Config
(
configPath
,
type
);
if
(
config
->
readConfigFile
(
(
*
configPath
)
))
if
(
config
->
readConfigFile
(
configPath
))
{
configs
->
push_back
(
std
::
shared_ptr
<
Config
>
{
config
});
}
...
...
@@ -346,16 +344,11 @@ std::vector<std::shared_ptr<Config>> Data::getAllLocalRequirements(std::shared_p
if
((
*
dependency
)
==
config
->
name_
)
{
// Check if already in vector
bool
found
=
false
;
for
(
auto
&&
requirement
=
requirements
.
begin
();
requirement
!=
requirements
.
end
();
++
requirement
)
{
if
((
*
requirement
)
->
name_
==
(
*
installedConfig
)
->
name_
)
{
found
=
true
;
break
;
}
}
bool
found
=
std
::
find_if
(
requirements
.
begin
(),
requirements
.
end
(),
[
&
installedConfig
](
const
std
::
shared_ptr
<
Config
>&
req
)
{
return
req
->
name_
==
(
*
installedConfig
)
->
name_
;
})
!=
requirements
.
end
();
if
(
!
found
)
{
...
...
@@ -569,10 +562,10 @@ void Data::addConfigSorted(std::vector<std::shared_ptr<Config>>& configs,
{
return
newConfig
->
name_
==
config
->
name_
;
})
!=
configs
.
end
();
if
(
!
found
)
{
for
(
auto
&&
config
=
configs
.
begin
();
config
!=
configs
.
end
();
config
++
)
for
(
auto
&&
config
=
configs
.
begin
();
config
!=
configs
.
end
();
++
config
)
{
if
(
newConfig
->
priority_
>
(
*
config
)
->
priority_
)
{
...
...
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