autoload: drop unused is_internalized property

This commit is contained in:
David Adam 2017-08-19 22:46:51 +08:00
parent a311f49eda
commit 0dce9a2114
2 changed files with 3 additions and 7 deletions

View file

@ -123,10 +123,8 @@ bool autoload_t::has_tried_loading(const wcstring &cmd) {
} }
/// @return Whether this function is stale. /// @return Whether this function is stale.
/// Internalized functions can never be stale.
static bool is_stale(const autoload_function_t *func) { static bool is_stale(const autoload_function_t *func) {
return !func->is_internalized && return time(NULL) - func->access.last_checked > kAutoloadStalenessInterval;
time(NULL) - func->access.last_checked > kAutoloadStalenessInterval;
} }
autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcstring &cmd, autoload_function_t *autoload_t::get_autoloaded_function_with_creation(const wcstring &cmd,
@ -182,7 +180,7 @@ bool autoload_t::locate_file_and_maybe_load_it(const wcstring &cmd, bool really_
// If we can use this function, return whether we were able to access it. // If we can use this function, return whether we were able to access it.
if (use_cached(func, really_load, allow_stale_functions)) { if (use_cached(func, really_load, allow_stale_functions)) {
return func->is_internalized || func->access.accessible; return func->access.accessible;
} }
} }

View file

@ -28,7 +28,7 @@ file_access_attempt_t access_file(const wcstring &path, int mode);
struct autoload_function_t { struct autoload_function_t {
explicit autoload_function_t(bool placeholder) explicit autoload_function_t(bool placeholder)
: access(), is_loaded(false), is_placeholder(placeholder), is_internalized(false) {} : access(), is_loaded(false), is_placeholder(placeholder) {}
/// The last access attempt recorded /// The last access attempt recorded
file_access_attempt_t access; file_access_attempt_t access;
@ -37,8 +37,6 @@ struct autoload_function_t {
/// Whether we are a placeholder that stands in for "no such function". If this is true, then /// Whether we are a placeholder that stands in for "no such function". If this is true, then
/// is_loaded must be false. /// is_loaded must be false.
bool is_placeholder; bool is_placeholder;
/// Whether this function came from a builtin "internalized" script.
bool is_internalized;
}; };
class env_vars_snapshot_t; class env_vars_snapshot_t;