ladybird/AK
William McPherson aa8b40dce6 Shell: Cache PATH for faster tab completion
This patch reduces the O(n) tab completion to something like O(log(n)).
The cache is just a sorted vector of strings and we binary search it to
get a string matching our input, and then check the surrounding strings
to see if we need to remove any characters. Also we no longer stat each
file every time.

Also added an #include in BinarySearch since it was using size_t. Oops.

If `export` is called, we recache. Need to implement the `hash` builtin
for when an executable has been added to a directory in PATH.
2019-12-05 17:09:22 +01:00
..
Tests AK: StringView::lines() should keep empty lines 2019-12-02 20:41:15 +01:00
Assertions.h AK: Remove unused AK::not_implemented() 2019-11-06 13:58:08 +01:00
Atomic.h AK: Atomic.h needs <stddef.h> for ptrdiff_t 2019-11-16 12:18:25 +01:00
Badge.h AK: Delete the Badge copy and move constructors. 2019-06-11 23:47:51 -07:00
BinarySearch.h Shell: Cache PATH for faster tab completion 2019-12-05 17:09:22 +01:00
Bitmap.h AK: Make Bitmap constructors public to allow make<Bitmap>() 2019-10-01 19:58:07 +02:00
BufferStream.h AK: Allow BufferStream to serialize/deserialize floats 2019-12-02 09:19:56 +01:00
ByteBuffer.h ByteBuffer: Remove pointer() in favor of data() 2019-09-30 08:57:01 +02:00
CircularDeque.h AK: Make it possible to store complex types in a CircularQueue 2019-10-23 12:27:43 +02:00
CircularQueue.h AK: Make it possible to store complex types in a CircularQueue 2019-10-23 12:27:43 +02:00
Demangle.h Kernel: Demangle kernel C++ symbols correctly again 2019-11-29 14:59:15 +01:00
DoublyLinkedList.h AK: Add DoublyLinkedList::prepend() 2019-12-02 18:36:10 +01:00
Error.h Add Error<> 2019-07-31 09:06:39 +02:00
FileSystemPath.cpp AK: Make FileSystemPath better at handling relative paths 2019-08-23 19:58:16 +02:00
FileSystemPath.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
FixedArray.h AK: Add a FixedArray<T> container 2019-08-07 20:05:36 +02:00
Function.h Add clang-format file 2019-05-28 17:31:20 +02:00
HashFunctions.h AK: Rename the common integer typedefs to make it obvious what they are. 2019-07-03 21:20:13 +02:00
HashMap.h AK: Add HashMap::find() with customizable finder callback 2019-08-25 06:45:27 +02:00
HashTable.h AK: Make HashTable.h compile inside the SDL2 port 2019-08-25 17:47:48 +02:00
InlineLinkedList.h AK: Add an iterator class for InlineLinkedList 2019-08-08 13:39:40 +02:00
InlineLRUCache.h AK: InlineLRUCache was always filling up one short of capacity. 2019-05-14 15:33:21 +02:00
install.sh Build: Install most headers to Root (and libcore.a/libgui.a) 2019-05-17 21:59:48 +02:00
IntrusiveList.h IntrusiveList: Make Iterator::operator* return a T& 2019-08-17 11:25:32 +02:00
IPv4Address.h AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
IterationDecision.h AK: Add IterationDecision.h. 2019-06-07 17:14:16 +02:00
JsonArray.h AK: Add JsonArray::ensure_capacity() 2019-10-23 14:55:21 +02:00
JsonArraySerializer.h Json: Add serializer fast-path for string values 2019-09-04 14:40:11 +02:00
JsonObject.h AK: Allow JsonValue to store 64-bit integers internally 2019-10-29 16:36:50 +01:00
JsonObjectSerializer.h Json: Add serializer fast-path for string values 2019-09-04 14:40:11 +02:00
JsonParser.cpp JsonParser: "" is an empty string, not a null value 2019-08-14 15:01:42 +02:00
JsonParser.h JsonParser: Fold extract_while() into parse_number() 2019-08-04 20:23:46 +02:00
JsonValue.cpp AK: Allow JsonValue to store 64-bit integers internally 2019-10-29 16:36:50 +01:00
JsonValue.h AK: Allow JsonValue to store 64-bit integers internally 2019-10-29 16:36:50 +01:00
kmalloc.h Kernel: Move kmalloc() into a Kernel/Heap/ directory 2019-09-16 09:01:44 +02:00
kstdio.h Kernel+LibC: Add a dbgputstr() syscall for sending strings to debug output. 2019-07-21 21:43:37 +02:00
LogStream.cpp AK: Get rid of TStyle (output styling helper for LogStream) 2019-11-06 11:37:03 +01:00
LogStream.h AK: Get rid of TStyle (output styling helper for LogStream) 2019-11-06 11:37:03 +01:00
MappedFile.cpp AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
MappedFile.h ByteBuffer: Remove pointer() in favor of data() 2019-09-30 08:57:01 +02:00
NetworkOrdered.h AK: Use __builtin_bswap() in NetworkOrdered. 2019-06-26 20:01:48 +02:00
Noncopyable.h AK: Add AK_MAKE_NONMOVABLE 2019-09-22 00:17:29 +02:00
NonnullOwnPtr.h AK: Delete operator!() and operator bool() from the Nonnull pointers 2019-11-07 18:00:05 +01:00
NonnullOwnPtrVector.h AK: Simplify NonnullPtrVector template a bit. 2019-07-25 11:10:28 +02:00
NonnullPtrVector.h NonnullPtrVector: Add ptr_at() getters for accessing the NonnullPtr 2019-08-19 19:04:52 +02:00
NonnullRefPtr.h AK: Delete operator!() and operator bool() from the Nonnull pointers 2019-11-07 18:00:05 +01:00
NonnullRefPtrVector.h AK: Simplify NonnullPtrVector template a bit. 2019-07-25 11:10:28 +02:00
Optional.h AK: Optional::operator bool() should consume the Optional 2019-08-25 06:45:09 +02:00
OwnPtr.h AK: Use int_hash() to generate less idiotic hashes for {Nonnull,}OwnPtr 2019-08-14 21:21:15 +02:00
Platform.h AK: Shim open_with_path_length() for non-Serenity builds. 2019-07-25 14:25:45 +02:00
PrintfImplementation.h AK: Implement %n printf specifier 2019-12-05 12:29:11 +01:00
Queue.h AK: Allow overriding the Queue segment size with a template parameter 2019-11-03 12:33:51 +01:00
QuickSort.h LibGUI: Run clang-format on everything. 2019-06-07 11:46:02 +02:00
RefCounted.h AK: Rename Retainable.h => RefCounted.h. 2019-06-21 18:58:45 +02:00
RefPtr.h AK: Make it possible to use HashMap<K, NonnullOwnPtr>::get() 2019-08-14 11:47:38 +02:00
Result.h Add Result<>, to use with/complement Error 2019-07-31 09:06:39 +02:00
ScopedValueRollback.h AK: Add ScopedValueRollback::set_override_rollback_value(). 2019-07-25 15:21:16 +02:00
ScopeGuard.h AK: ScopeGuard.h needs StdLibExtras.h 2019-06-18 09:31:14 +02:00
SinglyLinkedList.h AK: Add some missing includes in SinglyLinkedList. 2019-07-08 14:06:22 +02:00
StdLibExtras.h Kernel+AK: Remove AK/StdLibExtras.cpp, moving kernel stuff to Kernel/. 2019-07-29 11:58:44 +02:00
String.cpp AK: Add String::contains(String) 2019-10-28 19:08:48 +01:00
String.h AK: Add String::contains(String) 2019-10-28 19:08:48 +01:00
StringBuilder.cpp ByteBuffer: Remove pointer() in favor of data() 2019-09-30 08:57:01 +02:00
StringBuilder.h AK: Add StringBuilder::length() and trim(int) 2019-09-29 16:20:09 +02:00
StringImpl.cpp Revert "AK: Made Strings reversible" 2019-09-13 14:37:25 +02:00
StringImpl.h Revert "AK: Made Strings reversible" 2019-09-13 14:37:25 +02:00
StringView.cpp AK: StringView::lines() should keep empty lines 2019-12-02 20:41:15 +01:00
StringView.h LibMarkdown: Handle CRLF line endings 2019-12-02 13:52:42 +01:00
TemporaryChange.h Add clang-format file 2019-05-28 17:31:20 +02:00
TestSuite.h AK: Get rid of TStyle (output styling helper for LogStream) 2019-11-06 11:37:03 +01:00
Time.h AK: Make timeval_add() and timeval_sub() take references. 2019-06-06 18:02:28 +02:00
Traits.h AK: Make it possible to use HashMap<K, NonnullOwnPtr>::get() 2019-08-14 11:47:38 +02:00
Types.h AK: Add a useful align_up_to(value, power_of_two) function 2019-09-07 15:39:26 +02:00
URL.cpp AK: Add a query string component to URL 2019-11-25 21:21:27 +01:00
URL.h AK: Add a query string component to URL 2019-11-25 21:21:27 +01:00
Utf8View.cpp UTF-8: Add Utf8CodepointIterator::codepoint_length_in_bytes() 2019-10-18 22:49:23 +02:00
Utf8View.h UTF-8: Add Utf8CodepointIterator::codepoint_length_in_bytes() 2019-10-18 22:49:23 +02:00
Vector.h AK: Add Vector::take(index) 2019-11-07 20:38:33 +01:00
Weakable.h AK: Rename Retainable.h => RefCounted.h. 2019-06-21 18:58:45 +02:00
WeakPtr.h AK: Fix leak in WeakPtr(WeakPtr&&) and WeakPtr::operator=(WeakPtr&&) 2019-11-15 16:07:39 +01:00