From 38b2ac4f0458135c55e2871da04581a9d583c880 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 4 Sep 2024 23:08:44 +0300 Subject: [PATCH] fix initial array index value --- src/app/browser/main/tab/page/navbar/history.cpp | 2 +- src/app/browser/main/tab/page/navbar/history.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/browser/main/tab/page/navbar/history.cpp b/src/app/browser/main/tab/page/navbar/history.cpp index f37b3ada..02992170 100644 --- a/src/app/browser/main/tab/page/navbar/history.cpp +++ b/src/app/browser/main/tab/page/navbar/history.cpp @@ -40,7 +40,7 @@ void History::add( if (FOLLOW) { - index = memory.size(); // @TODO not last index, use iterator + index = memory.size() - 1; } } diff --git a/src/app/browser/main/tab/page/navbar/history.hpp b/src/app/browser/main/tab/page/navbar/history.hpp index 173bc0f3..f6a27f02 100644 --- a/src/app/browser/main/tab/page/navbar/history.hpp +++ b/src/app/browser/main/tab/page/navbar/history.hpp @@ -22,7 +22,7 @@ namespace app::browser::main::tab::page::navbar history::Back * historyBack; history::Forward * historyForward; - int index = 0; + int index = -1; public: