From 4b452d4efb8cbab48129189833ac8af9a1d02a2f Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Fri, 10 Sep 2021 08:22:40 -0500 Subject: perf(lua): optimize vim.deep_equal #15236 By remembering the keys already compared in repeating a comparison is avoided. Thanks: https://stackoverflow.com/a/32660766 --- runtime/doc/lua.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 3fd3875557..991bab6c9f 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1268,7 +1268,17 @@ schedule_wrap({cb}) *vim.schedule_wrap()* deep_equal({a}, {b}) *vim.deep_equal()* - TODO: Documentation + Deep compare values for equality + + Tables are compared recursively unless they both provide the `eq` methamethod. + All other types are compared using the equality `==` operator. + + Parameters: ~ + {a} first value + {b} second value + + Return: ~ + `true` if values are equals, else `false` . deepcopy({orig}) *vim.deepcopy()* Returns a deep copy of the given object. Non-table objects are -- cgit