mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Remove some dead code
These functions were unused.
This commit is contained in:
parent
7b1321f9a1
commit
1763e7d3bc
6 changed files with 1 additions and 34 deletions
|
@ -1621,11 +1621,6 @@ bool unescape_string(const wcstring &input, wcstring *output, unescape_flags_t e
|
|||
return unescape_string(input.c_str(), input.size(), output, escape_special, style);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void bugreport() {
|
||||
FLOG(error, _(L"This is a bug. Break on 'bugreport' to debug."));
|
||||
FLOG(error, _(L"If you can reproduce it, please report: "), PACKAGE_BUGREPORT, L'.');
|
||||
}
|
||||
|
||||
wcstring format_size(long long sz) {
|
||||
wcstring result;
|
||||
const wchar_t *sz_name[] = {L"kB", L"MB", L"GB", L"TB", L"PB", L"EB", L"ZB", L"YB", nullptr};
|
||||
|
|
|
@ -519,9 +519,6 @@ bool unescape_string(const wcstring &input, wcstring *output, unescape_flags_t e
|
|||
/// Write the given paragraph of output, redoing linebreaks to fit \p termsize.
|
||||
wcstring reformat_for_screen(const wcstring &msg, const termsize_t &termsize);
|
||||
|
||||
/// Print a short message about how to file a bug report to stderr.
|
||||
void bugreport();
|
||||
|
||||
/// Return the number of seconds from the UNIX epoch, with subsecond precision. This function uses
|
||||
/// the gettimeofday function and will have the same precision as that function.
|
||||
using timepoint_t = double;
|
||||
|
|
|
@ -543,13 +543,6 @@ const job_t *parser_t::job_with_id(job_id_t id) const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
const job_t *parser_t::job_with_internal_id(internal_job_id_t id) const {
|
||||
for (const auto &job : job_list) {
|
||||
if (job->internal_job_id == id) return job.get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
job_t *parser_t::job_get_from_pid(pid_t pid) const {
|
||||
for (const auto &job : jobs()) {
|
||||
for (const process_ptr_t &p : job->processes) {
|
||||
|
|
|
@ -398,9 +398,6 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
|
|||
/// Return the job with the specified job id. If id is 0 or less, return the last job used.
|
||||
const job_t *job_with_id(job_id_t job_id) const;
|
||||
|
||||
/// Return the job with the specified internal job id.
|
||||
const job_t *job_with_internal_id(internal_job_id_t job_id) const;
|
||||
|
||||
/// Returns the job with the given pid.
|
||||
job_t *job_get_from_pid(pid_t pid) const;
|
||||
|
||||
|
|
|
@ -686,16 +686,6 @@ bool is_token_delimiter(wchar_t c, bool is_first, maybe_t<wchar_t> next) {
|
|||
return c == L'(' || !tok_is_string_character(c, is_first, next);
|
||||
}
|
||||
|
||||
wcstring tok_first(const wcstring &str) {
|
||||
tokenizer_t t(str.c_str(), 0);
|
||||
if (auto token = t.next()) {
|
||||
if (token->type == token_type_t::string) {
|
||||
return t.text_of(*token);
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
wcstring tok_command(const wcstring &str) {
|
||||
tokenizer_t t(str.c_str(), 0);
|
||||
while (auto token = t.next()) {
|
||||
|
|
|
@ -136,12 +136,7 @@ class tokenizer_t : noncopyable_t {
|
|||
/// Tests if this character can delimit tokens.
|
||||
bool is_token_delimiter(wchar_t c, bool is_first, maybe_t<wchar_t> next);
|
||||
|
||||
/// Returns only the first token from the specified string. This is a convenience function, used to
|
||||
/// retrieve the first token of a string. This can be useful for error messages, etc. On failure,
|
||||
/// returns the empty string.
|
||||
wcstring tok_first(const wcstring &str);
|
||||
|
||||
/// Like to tok_first, but skip variable assignments like A=B.
|
||||
/// \return the first token from the string, skipping variable assignments like A=B.
|
||||
wcstring tok_command(const wcstring &str);
|
||||
|
||||
/// Struct wrapping up a parsed pipe or redirection.
|
||||
|
|
Loading…
Reference in a new issue