mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 23:21:15 -03:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user