Skip to content

Commit

Permalink
refactor: simplify index checking
Browse files Browse the repository at this point in the history
  • Loading branch information
vitekcerny authored and Lea Mikulcová committed May 19, 2024
1 parent 4cb0a26 commit 3ec3bf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2490,7 +2490,7 @@ content::NavigationEntry* WebContents::GetNavigationEntryAtIndex(
}

bool WebContents::DeleteNavigationEntryAtIndex(int index) {
if (index < 0 || index >= GetHistoryLength())
if (!CanGoToIndex(index))
return false;

return web_contents()->GetController().RemoveEntryAtIndex(index);
Expand Down

0 comments on commit 3ec3bf4

Please sign in to comment.