mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
Kernel: Use range-for wherever possible
This commit is contained in:
parent
c6fafd3e90
commit
949ea9cb4a
3 changed files with 4 additions and 5 deletions
|
@ -198,7 +198,7 @@ public:
|
||||||
, m_capabilities(capabilities)
|
, m_capabilities(capabilities)
|
||||||
{
|
{
|
||||||
if constexpr (PCI_DEBUG) {
|
if constexpr (PCI_DEBUG) {
|
||||||
for (auto capability : capabilities)
|
for (const auto& capability : capabilities)
|
||||||
dbgln("{} has capability {}", address, capability.id());
|
dbgln("{} has capability {}", address, capability.id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ DeviceController::DeviceController(Address address)
|
||||||
|
|
||||||
bool DeviceController::is_msi_capable() const
|
bool DeviceController::is_msi_capable() const
|
||||||
{
|
{
|
||||||
for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||||
if (capability.id() == PCI_CAPABILITY_MSI)
|
if (capability.id() == PCI_CAPABILITY_MSI)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ bool DeviceController::is_msi_capable() const
|
||||||
}
|
}
|
||||||
bool DeviceController::is_msix_capable() const
|
bool DeviceController::is_msix_capable() const
|
||||||
{
|
{
|
||||||
for (auto capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
for (const auto& capability : PCI::get_physical_id(pci_address()).capabilities()) {
|
||||||
if (capability.id() == PCI_CAPABILITY_MSIX)
|
if (capability.id() == PCI_CAPABILITY_MSIX)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,8 +185,7 @@ public:
|
||||||
template<typename F>
|
template<typename F>
|
||||||
IterationDecision for_each_framebuffer(F f)
|
IterationDecision for_each_framebuffer(F f)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < VIRTIO_GPU_MAX_SCANOUTS; i++) {
|
for (auto& scanout : m_scanouts) {
|
||||||
auto& scanout = m_scanouts[i];
|
|
||||||
if (!scanout.framebuffer)
|
if (!scanout.framebuffer)
|
||||||
continue;
|
continue;
|
||||||
IterationDecision decision = f(*scanout.framebuffer, *scanout.console);
|
IterationDecision decision = f(*scanout.framebuffer, *scanout.console);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue