Remove obsolete comments

If arguments always have the same value they do not need to be arguments.
For `HistoryImpl::add`, the comments are incorrect (assuming they should
indicate the value of the argument), since both arguments can be true or false
independently.
`History::add` is only called at one location in a test with a constant value of
`false` for `pending`. This might mean that the parameter could be deleted, or
maybe even the entire function, if testing can work without it.
This commit is contained in:
Daniel Rainer
2025-06-04 00:50:21 +02:00
parent f438e80f9b
commit 77738fd646

View File

@@ -395,12 +395,7 @@ fn history_file_path(&self) -> std::io::Result<Option<WString>> {
/// `item_at_index()` until a call to `resolve_pending()`. Pending items are tracked with an
/// offset into the array of new items, so adding a non-pending item has the effect of resolving
/// all pending items.
fn add(
&mut self,
item: HistoryItem,
pending: bool, /*=false*/
do_save: bool, /*=true*/
) {
fn add(&mut self, item: HistoryItem, pending: bool, do_save: bool) {
// We use empty items as sentinels to indicate the end of history.
// Do not allow them to be added (#6032).
if item.contents.is_empty() {
@@ -1283,7 +1278,7 @@ fn imp(&self) -> MutexGuard<HistoryImpl> {
/// Privately add an item. If pending, the item will not be returned by history searches until a
/// call to resolve_pending. Any trailing ephemeral items are dropped.
/// Exposed for testing.
pub fn add(&self, item: HistoryItem, pending: bool /*=false*/) {
pub fn add(&self, item: HistoryItem, pending: bool) {
self.imp().add(item, pending, true)
}