mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
AK: Make Vector use size_t for its size and capacity
This commit is contained in:
parent
9c6f7d3e7d
commit
ceec1a7d38
Notes:
sideshowbarker
2024-07-19 09:04:32 +09:00
Author: https://github.com/awesomekling
Commit: ceec1a7d38
94 changed files with 323 additions and 317 deletions
|
@ -58,9 +58,9 @@ void BoxLayout::run(Widget& widget)
|
|||
if (should_log)
|
||||
dbgprintf("BoxLayout: Starting with available size: %s\n", available_size.to_string().characters());
|
||||
|
||||
int last_entry_with_automatic_size = -1;
|
||||
Optional<size_t> last_entry_with_automatic_size;
|
||||
|
||||
for (int i = 0; i < m_entries.size(); ++i) {
|
||||
for (size_t i = 0; i < m_entries.size(); ++i) {
|
||||
auto& entry = m_entries[i];
|
||||
if (entry.type == Entry::Type::Spacer) {
|
||||
++number_of_visible_entries;
|
||||
|
@ -123,7 +123,7 @@ void BoxLayout::run(Widget& widget)
|
|||
int current_x = margins().left();
|
||||
int current_y = margins().top();
|
||||
|
||||
for (int i = 0; i < m_entries.size(); ++i) {
|
||||
for (size_t i = 0; i < m_entries.size(); ++i) {
|
||||
auto& entry = m_entries[i];
|
||||
if (entry.type == Entry::Type::Spacer) {
|
||||
current_x += automatic_size.width();
|
||||
|
@ -141,7 +141,7 @@ void BoxLayout::run(Widget& widget)
|
|||
}
|
||||
ASSERT(entry.widget);
|
||||
|
||||
if (i == last_entry_with_automatic_size) {
|
||||
if (last_entry_with_automatic_size.has_value() && i == last_entry_with_automatic_size.value()) {
|
||||
rect.set_size(automatic_size_for_last_entry);
|
||||
} else {
|
||||
rect.set_size(automatic_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue